Repository navigation
Fix HAProxy client IP regex to support IPv6 addresses - #542
Draft
IsuruDilhan wants to merge 1 commit into
Draft
IsuruDilhan wants to merge 1 commit into
IsuruDilhan wants to merge 1 commit into
Conversation
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.
👷 Deploy request for fluentd-website pending review.Visit the deploys page to approve it
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses fluent/fluentd-docs-gitbook#271 (reported against the docs-gitbook repo, but the actual recipe source lives here).
Problem: the
c_ipcapture 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 thec_ipcharacter class in all three occurrences of the pattern insource/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:
c_ip="127.0.0.1", `c_port="45111"" (unchanged behavior)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.