Hi,
Le 27/03/2018 à 18:49, Franks Andy (IT Technical Architecture Manager) a
écrit :
Hi all,
Logging with HTTP as standard, the %{+Q}r log variable records the
requested URL in the logs. I’d like to also record the URL that’s
actually fetch after an http-request set-path directive is given (for
debugging purposes). It’s linked to an application that provides next to
no debugging, and tcpdump isn’t much help either – having it in haproxy
logs would be really useful.
Can I do this or am I thinking too much outside the box? I tried setting
a dynamic variable and then setting that in the frontend log-format, but
it didn’t seem to record anything even despite populating the variable.
You should share your configuration to help diagnose what was wrong in it.
Something like this should work :
http-request set-path /rewritten
http-request set-var(txn.path_rewrite) path
log-format %{+Q}r\ %{+Q}[var(txn.path_rewrite)]
--
Cyril Bonté