MINOR: log: Logging HTTP path only with %HPO
authorMaciej Zdeb <maciej@zdeb.pl>
Mon, 30 Nov 2020 18:27:47 +0000 (18:27 +0000)
committerWilly Tarreau <w@1wt.eu>
Tue, 1 Dec 2020 08:32:44 +0000 (09:32 +0100)
commitfcdfd857b3d2e7181e96c182cede96fc9aa3c099
tree4a8aba6487d4888da24a38462f9af21a2580f410
parentc94431b308414b13f92b55fb429637dba15e1456
MINOR: log: Logging HTTP path only with %HPO

This patch adds a new logging variable '%HPO' for logging HTTP path only
(without query string) from relative or absolute URI.

For example:
log-format "hpo=%HPO hp=%HP hu=%HU hq=%HQ"

GET /r/1 HTTP/1.1
=>
hpo=/r/1 hp=/r/1 hu=/r/1 hq=

GET /r/2?q=2 HTTP/1.1
=>
hpo=/r/2 hp=/r/2 hu=/r/2?q=2 hq=?q=2

GET http://host/r/3 HTTP/1.1
=>
hpo=/r/3 hp=http://host/r/3 hu=http://host/r/3 hq=

GET http://host/r/4?q=4 HTTP/1.1
=>
hpo=/r/4 hp=http://host/r/4 hu=http://host/r/4?q=4 hq=?q=4
doc/configuration.txt
include/haproxy/log-t.h
reg-tests/log/log_uri.vtc [new file with mode: 0644]
src/log.c