Quantcast
Channel: HAProxy community - Latest topics
Viewing all articles
Browse latest Browse all 4832

Choosing between "capture request header" vs. "http-request capture req.hdr"

$
0
0

Howdy;
I’m using a custom json-formatted log_format in HaProxy 2.8 LTS, and wanted to record a few headers from requests to frontends (http, https).

I noticed we were doing it two ways (different devs over different time periods):

capture request header User-Agent len 256
http-request capture req.hdr(User-Agent) len 256

Both syntaxes seem to work in the log_format (this is an excerpt):
..."user-agent":"%[capture.req.hdr(0),json(utf8ps)]"...

Reading the docs, I think capture request header is more appropriate.

Anyone have wise council or examples of when you’d pick one over the other?

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 4832

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>