@@ -21619,6 +21619,7 @@ hostname string
2161921619int(<integer>) signed
2162021620ipv4(<ipv4>) ipv4
2162121621ipv6(<ipv6>) ipv6
21622+ last_entity string
2162221623last_rule_file string
2162321624last_rule_line integer
2162421625lat_ns_avg integer
@@ -21887,6 +21888,35 @@ ipv4(<ipv4>) : ipv4
2188721888ipv6(<ipv6>) : ipv6
2188821889 Returns an ipv6.
2188921890
21891+ last_entity : string
21892+ This returns the identity of the last entity that was evaluated during stream
21893+ analysis. It may be the final rule that matched or the filter that
21894+ interrupted the processing.
21895+
21896+ A final rule is one that terminates the evaluation of the rule set (like an
21897+ "accept", "deny" or "redirect"). This works for TCP request and response
21898+ rules acting on the "content" rulesets, and on HTTP rules from
21899+ "http-request", "http-response" and "http-after-response" rule sets. The
21900+ legacy "redirect" rulesets are not supported (such information is not stored
21901+ there), and neither "tcp-request connection" nor "tcp-request session"
21902+ rulesets are supported because the information is stored at the stream level
21903+ and streams do not exist during these rules. In that case, the returned value
21904+ is equivalent to "last_rule_file:last_rule_line".
21905+ See also "last_rule_file", "last_rule_line".
21906+
21907+ For a filter, its identifier is returned as defined by the developers. If
21908+ this identifier is not defined, an hexadecimal value is returned
21909+ corresponding to an unique internal identifier.
21910+
21911+ The main purpose of this function is to be able to report in logs the last
21912+ entity that interrupted a processing, in order to help debugging issues. The
21913+ information returned on entities may changed in time and must not be used for
21914+ something else than debugging.
21915+
21916+ Example:
21917+ # Log the last entity, if any, and only if an error is reported
21918+ log-format "$HAPROXY_HTTP_LOG_FMT %{Q}[last_entity,when(error)]
21919+
2189021920last_rule_file : string
2189121921 This returns the name of the configuration file containing the last final
2189221922 rule that was matched during stream analysis. A final rule is one that
0 commit comments