I'm trying to capture the unique id for each request in my logs. I thought I could use capture request header X-Unique-ID len 16
on the header but its not working. Any suggestions?
global
log /dev/log local1
maxconn 4096
user haproxy
group haproxy
daemon
stats socket /var/run/haproxy.sock mode 600 level admin
spread-checks 5
defaults
log global
mode http
option httplog
option dontlog-normal
option log-separate-errors
option dontlognull
retries 2
option redispatch
maxconn 2000
timeout connect 5s
timeout client 15s
timeout server 10s
#option forwardfor
#option http-server-close
frontend http-in
bind *:8080
monitor-uri /haproxy-health
unique-id-header X-Unique-ID
unique-id-format %{+X}o\ %ci:%cp_%fi:%fp_%Ts_%rt:%pid
capture request header Host len 32
capture request header User-Agent len 200
capture request header X-Unique-ID len 16
rspidel ^X-Powered-By:.*
default_backend application-backend
backend application-backend
balance leastconn
option httpclose
option forwardfor
option httpchk
http-check send-state
http-send-name-header Node-Name
#http-check expect status 200
#cookie JSESSIONID prefix
server test1 192.168.1.73:80
#server 10.0.1.102:80 cookie A check