]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: log: Be able to use %ID alias at anytime of the stream's evaluation
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 23 Jun 2025 05:50:01 +0000 (07:50 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 24 Jun 2025 06:04:50 +0000 (08:04 +0200)
commit20a82027ceb7a46ce2a0cbe05e40c63d132601f7
tree6c1e69ab35378e6c89bdf60565742be1c98b2a1f
parentfb7b5c8a53cb4f19a223abd20660d47162aa8708
BUG/MINOR: log: Be able to use %ID alias at anytime of the stream's evaluation

In a log-format string, using "%[unique-id]" or "%ID" should be equivalent.
However, for the first one, the unique ID is generated when the sample fetch
function is called. For the alias, it is not true. It that case, the
stream's unique ID is generated when the log message is emitted. Otherwise,
by default, the unique id is automatically generated at the end of the HTTP
request analysis.

So, if the alias "%ID" is use in a log-format string anywhere before the end
of the request analysis, the evaluation failed and the ID is considered as
empty. It is not consistent and in contradiction with the "%ID"
documentation.

To fix the issue, instead of evaluating the unique ID when the log message
is emitted, it is now performed on demand when "%ID" format is evaluated.

This patch should fix the issue #3016. It should be backported to all stable
versions. It relies on the following commit:

  * BUG/MINOR: stream: Avoid recursive evaluation for unique-id based on itself
src/log.c