]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: stream: add "last_rule_file" and "last_rule_line" samples
authorWilly Tarreau <w@1wt.eu>
Wed, 9 Mar 2022 16:33:05 +0000 (17:33 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 10 Mar 2022 10:51:34 +0000 (11:51 +0100)
commit0657b93385b194d6e597d49c03ee05cefb38c78d
treee4109bc581338080bb3abf167f743fd24d1ebd3d
parentc6dae869ca8baa9b6be0bd1012749eed268988dc
MINOR: stream: add "last_rule_file" and "last_rule_line" samples

These two sample fetch methods report respectively the file name and the
line number where was located the last rule that was final. This is aimed
at being used on log-format lines to help admins figure what rule in the
configuration gave a final verdict, and help understand the condition
that led to the action.

For example, it's now possible to log the last matched rule by adding
this to the log-format:

  ... lr=%[last_rule_file]:%[last_rule_line]

A regtest is provided to test various combinations of final rules, some
even on top of each other from different rulesets.
doc/configuration.txt
reg-tests/log/last_rule.vtc [new file with mode: 0644]
src/stream.c