Skip to content

Fix HAProxy client IP regex to support IPv6 addresses - #542

Draft
IsuruDilhan wants to merge 1 commit into
fluent:masterfrom
IsuruDilhan:fix/haproxy-ipv6-client-ip-regex
Draft

IsuruDilhan wants to merge 1 commit into
fluent:masterfrom
IsuruDilhan:fix/haproxy-ipv6-client-ip-regex

Conversation

@IsuruDilhan

Copy link
Copy Markdown

Addresses fluent/fluentd-docs-gitbook#271 (reported against the docs-gitbook repo, but the actual recipe source lives here).

Problem: the c_ip capture group in the HAProxy → Elasticsearch recipe's example regexes only allows [\w\.], so any IPv6 client address (e.g. ::ffff:195.95.239.60) fails to match, breaking log parsing for IPv6 hosts as reported in the issue.

Fix: add : to the c_ip character class in all three occurrences of the pattern in source/guides/recipes/_haproxy-elasticsearch.md.erb, per the fix already suggested by @Watson1978 on the issue.

Verified with a standalone Ruby regex test (not full site build) against both an IPv4 and an IPv6 HAProxy log line:

  • IPv4: c_ip="127.0.0.1", `c_port="45111"" (unchanged behavior)
  • IPv6: c_ip="::ffff:195.95.239.60", c_port="54241" (previously failed to match at all)

Draft for now pending my own final review before marking ready.

The c_ip capture group only allowed [\w\.], so any IPv6 client
address (e.g. ::ffff:195.95.239.60) failed to match and broke
log parsing. Adding : to the character class fixes it without
affecting IPv4 parsing.
@netlify

netlify Bot commented Nov 27, 2026

Copy link
Copy Markdown

👷 Deploy request for fluentd-website pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 0aa3646

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant