Backport(v1.19): parser_syslog: fix NameError when RFC3164 timestamp has repeated spaces (#5449) - #5497
Merged
Conversation
The string parser's RFC3164 path slices the timestamp with an `idx` variable that only exists in the regexp parser, so any input taking the repeated-space branch raised NameError instead of being parsed. This branch is reachable whenever `time_format` contains a space and the timestamp is space-padded, for example `%Y-%m-%d %H:%M:%S` against `<14>2026-04-25 16:43:29 host app: msg`. This is the NameError part of fluent#5449 only. The rest of that PR makes the parser accept a space after the priority, which changes behavior, so it is left out of this backport. Signed-off-by: Shizuo Fujita <fujita@clear-code.com>
kenhys
approved these changes
Sep 15, 2026
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.
Which issue(s) this PR fixes:
Partial backport of #5449
Related to #5496
Fixes #
What this PR does / why we need it:
The RFC3164 string parser slices the timestamp with an
idxvariable that only exists in the regexp parser, so any message taking the repeated-space branch raisedNameErrorinstead of being parsed. That branch is reached whenevertime_formatcontains a space and the timestamp is space-padded, for example%Y-%m-%d %H:%M:%Sagainst<14>2026-04-25 16:43:29 host app: msg.This backports only the
NameErrorfix. The rest of #5449 makes the parser accept a space after the priority, which changes behavior, so it is left out.Docs Changes:
N/A
Release Note: