Hello again and very sorry for the late response,

1)

On 26.04.2017 15:38, Swapnil Dubey wrote:
For logging please if you can try this to see if it works, though I have not tested it.

log-format %{+Q}[req.payload(3,8)]

That does not work, but I figured how the capturing and logging does work

 # capture 20 bytes starting at byte 16
 tcp-request content capture req.payload(16,20) len 20

 # log capture slot 0#
 log-format "capture0: %[capture.req.hdr(0)]"


In the HAProxy log this is then logged:

 haproxy[$pid]: capture0: AAAAAAAAAAAAA


I am now able to capture some bytes, or rather "string", of the payload and also log it. I was even able apply sample filters like base64 or hex to it ;-)





2) Unfortunately my intended capture would actually be longer, But the it contains terminating null-bytes separating multiple strings and HAProxy seems to stop capturing at the first \0 byte there or at least only let's me log the first string. According to the documentation (https://cbonte.github.io/haproxy-dconv/1.6/configuration.html#7.3.5-req.payload) is captured as binary, so this should not be the case, but it apparently is.

a) I tried to log / dump it using hex or base64 to preserve the whole capture ... but no luck, yet. b) As for logging the raw data in nothing like capture-req seems available. Maybe I missed some other custom log variable to use here?




Maybe you have some other ideas or hints on how to log that captured data?



Regards

Christian


Reply via email to