]> git.kaiwu.me - haproxy.git/commit
MINOR: halog: Add support filtering on header capture values using -hdr-match
authorTim Duesterhus <tim@tideways-gmbh.com>
Wed, 15 Jul 2026 15:14:00 +0000 (17:14 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 24 Jul 2026 09:37:53 +0000 (11:37 +0200)
commit60d69aacea108a302a5f85433273e4ded7da5659
tree23a896f8acde381e2112221ed7a4cf28b2c81b45
parentbd66357c4c52e130f014474fd0ec42c2ed23a649
MINOR: halog: Add support filtering on header capture values using -hdr-match

This patch extends the existing support for printing captured header fields
(`-hdr`) by a new filter (`-hdr-match`) that only processes lines where the
given capture has a specific value. It works together with all existing filters
and output formats.

The full syntax is `-hdr-match <block>:<field>=<value>`, where <block> and <field>
work just like `-hdr` and `<value>` is an exact string match:

Example:

    capture request  header a len 50
    capture request  header b len 50
    capture request  header c len 50
    capture response header d len 50
    capture response header e len 50
    capture response header f len 50

- `-hdr-match 1:1=foo` will filter for requests where `a` is equal to "foo".
- `-hdr-match "2:3=foo bar"` will filter for requests where `f` is equal to
  "foo bar".

The chosen syntax leaves future scope for allowing `<block>:<field>*<value>`
for substring matches and `<block>:<field>^<value>` for prefix matches without
introducing a breaking change.
admin/halog/halog.c