Skip to content

Fix outdated regexp of apache2 parser#647

Merged
kenhys merged 1 commit into
fluent:1.0from
Watson1978:docs-fix-apache2-regexp
Jul 24, 2026
Merged

Fix outdated regexp of apache2 parser#647
kenhys merged 1 commit into
fluent:1.0from
Watson1978:docs-fix-apache2-regexp

Conversation

@Watson1978

Copy link
Copy Markdown
Contributor

The regexp shown in parser/apache2.md was the one used before v1.14.2.

The expression was updated at fluent/fluentd@db93f4b

The regexp shown in parser/apache2.md was the one used before v1.14.2.

Escape sequences were first allowed by df5ac352 "Allow escape sequences in
Apache access log" (v0.14.14), which used `(?:[^\"]|\\.)`, and that is the
form the document still shows. The source was later narrowed by db93f4b9
"parser_apache2: Fix too wide matching regexp" (v1.14.2):

    -      REGEXP = ... (?<path>(?:[^\"]|\\.)*?) ... (?<referer>(?:[^\"]|\\.)*) ... (?<agent>(?:[^\"]|\\.)*) ...
    +      REGEXP = ... (?<path>(?:[^\"]|\\")*?) ... (?<referer>(?:[^\"]|\\")*) ... (?<agent>(?:[^\"]|\\")*) ...

The document was not updated at that time. So it still says that any
backslash-escaped character is accepted in path, referer and agent, while
the current implementation accepts only an escaped double quote.

The new text is copied from Apache2Parser::REGEXP.source of the v1.19
branch and was compared with the document line to confirm they are
identical.

Signed-off-by: Shizuo Fujita <fujita@clear-code.com>
@Watson1978
Watson1978 requested a review from kenhys July 24, 2026 01:58
@kenhys
kenhys merged commit ab8daeb into fluent:1.0 Jul 24, 2026
2 checks passed
@Watson1978
Watson1978 deleted the docs-fix-apache2-regexp branch July 24, 2026 02:27
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.

2 participants