Le 14/05/2020 à 07:38, Tom a écrit :
Hi

I'm still searching a way for capturing the request payload with
haproxy-2.1.3 as it was possible with haproxy-1.8.x.

config-snippet:

-------

declare capture request len 90000
declare capture response len 90000
log-format "srcip=%ci:%cp feip=%fi:%fp(%f,%ft,%fc) beip=%bi:%bp(%b,%bc)
serverip=%si:%sp(%s) "%r" %ac/%fc/%bc/%sc/%rc %sq/%bq requests=%rt
resptime=%Tr bytesread=%B status=%ST tsc=%tsc sslv=%sslv ms=%ms
request=%hr response=%hs"
http-request capture req.payload(0,0) id 0
http-response capture res.payload(0,0) id 0

-------

The log shows only "{#DO?} instead of the requested payload:

...sslv=TLSv1.3 ms=325 request={#D0?} response={#D0?}


Any hints for this? Or another way configuring this?


Hi,

The internal representation of HTTP messages has changed in 1.9. Before, the message was stored in raw. But to fully support H2 and future HTTP versions, we decided to change it to a structured representation, called HTX. In 1.9 and 2.0, both representations are available. In 1.9, the old one is the default. In 2.0, it is the new one. For these both versions, you should set or unset the http-use-htx option in your configuration to change the HTTP messages representation.

But, in the 2.1, the old HTTP representation was dropped. req.payload() and res.payload() are L6 sample fetches. So there are not aware of this representation. It is no longer possible to get the HTTP message using these sample fetches. I must fix that in a way or another.

For now, you may use req.hdrs() to get all request headers. Unfortunately res.hdrs() was introduced recently in the 2.2. I guess it could be backported. In the same way, the request body can be retrieve using req.body. Here too, res.body was introduced in the 2.2 and could probably be backported.

--
Christopher Faulet

Reply via email to