0

Good day!!

I am pretty new to HA Proxy and I am trying to log all http details using httplog option. Where I am able to capture all the details except cookie request and response. I need to capture them to be able to understand users behaviour on our websites.

I have found some reference on google like below,

capture cookie name len 10

note: I am using marathon-lb haproxy official docker image

I am not able understand what should I give at "name" so that it can capture ? or If there is any way to capture ?

thanks in advance for your help :)

1 Answers1

1

To log cookies you'll need to capture as you note, where name is the name of the cookie you want to capture.

To log the captured cookies, you'll use

%CC #captured_request_cookie
%CS #captured_response_cookie

You will have to use the log-format option and create a custom log that includes those cookies.

Doc section https://cbonte.github.io/haproxy-dconv/1.8/configuration.html#8.2.4

jmoney
  • 443
  • 2
  • 10
  • Note that HAProxy cookie capture supports capturing exactly one cookie. If you would want to capture multiple cookies in your logs, HAProxy doesn't support it. – Mikko Rantalainen Apr 25 '22 at 13:01