Thank you very much Cyril! req.fhdr() did the trick!

> Le 20/07/2016 à 11:48, hapr...@abisoft.biz a écrit :
>> Sure thing. Here is the full config (Haproxy 1.6.7):
>>
>> [...]
>> defaults
>>   mode http
>> [...]
>>   log-format %ci:%cp\ [%t]\ %ft\ %b/%s\ %Tq/%Tw/%Tc/%Tr/%Tt\ %tsc\ 
>> %ac/%fc/%bc/%sc/%rc\ %sq/%bq\ %{+Q}r\ %ST\ "%CC"\ "%hr"\ "%CS"\ "%hs"\ 
>> ireq_size=%U\ resp_size=%B\ %fi:%fp\ %si:%sp\ %sslc\ %sslv\ 
>> %[capture.req.hdr(0)]
>>
>> frontend lb-useast
>>   mode http
>>   bind *:80
>>   option forwardfor except 127.0.0.0/8
>>
>> **  http-request add-header X-Haproxy-ACL test,
>>
>>   declare capture request len 256
>>   http-request capture hdr(X-Haproxy-ACL) id 0
>>
>> [...]
>> Notice the line marked "**". When it has "test," it doesn't appear in the log

> Ah ok, then this has nothing to do with "http-request add-header", but 
> the understanding of the hdr() fetch.

> hdr() will use the commas as separator, hence it will fetch the last 
> occurence (the empty value behind your comma).
> If you want to capture the whole header line, you want to use fhdr() 
> instead.

> http://cbonte.github.io/haproxy-dconv/1.6/configuration.html#req.hdr

> vs

> http://cbonte.github.io/haproxy-dconv/1.6/configuration.html#req.fhdr


> Not tested but I'm almost sure it's your issue.


Reply via email to