-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
libbeat/reader/syslog: relax timestamp parsing to allow leading zero #31254
Conversation
Pinging @elastic/security-external-integrations (Team:Security-External Integrations) |
This pull request is now in conflicts. Could you fix it? 🙏
|
This change relaxes the RFC3164 timestamp grammar to allow dates with a leading zero to be parsed as valid syslog timestamps, bringing the parser's behaviour into line with the parser in filebeat/input/syslog.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
As much as I'd like to strictly adhere to RFC, it doesn't help us trying to ingest from as many sources as possible. The more I look at it, the more I realize it is not our job to be enforcers of RFC, there are better tools out there if a user really wants to do that. I think for us, leaning towards best effort rather than strict RFC adherence is the way to go. Another example would be my latest change that makes the priority field optional, which is a blatant violation of RFC (yet many syslog providers do just that). I have been looking at making the parser a lot more tolerant and being able to recover from certain errors, but it's proving to be more difficult and time consuming than I'd like. @efd6 I know you recently did some work with the cef decoder and recovery. Feel free to look at it if you've got time. The problem I'm running into is getting the state machine to transition to the "next state" (easier said than done). Further discussion on that topic should probably be done on the main issue, #31246 |
Should this be backported to 8.2.0? |
Happy to take a look @taylor-swanson — I'm not surprised you are having difficulties; starting a robust machine with throwing out your invariants is hard/foolish (coming from someone who has spent time doing that foolishness). This should be back ported if it's considered a bug. @andrewkroh? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC we documented the time parsing behavior of the syslog processor/parser and deviations from the RFC. Please check the docs and update them accordingly.
As for backports, I think this should go into 8.2.
@andrewkroh Please take a look at the doc wording. Also, since the issue that this fixes has been around for two years, should I back port to 7.17, |
The |
…31254) (#31315) This change relaxes the RFC3164 timestamp grammar to allow dates with a leading zero to be parsed as valid syslog timestamps, bringing the parser's behaviour into line with the parser in filebeat/input/syslog. (cherry picked from commit e1a7f6d) Co-authored-by: Dan Kortschak <[email protected]>
…er-tar-gz * upstream/main: (139 commits) [Automation] Update elastic stack version to 8.3.0-c655cda8 for testing (elastic#31322) Define a queue metrics reporter interface (elastic#31289) [Oracle Module] Change tablespace metricset collection period (elastic#31259) libbeat/reader/syslog: relax timestamp parsing to allow leading zero (elastic#31254) [Automation] Update elastic stack version to 8.3.0-55ba6f37 for testing (elastic#31311) [libbeat] Remove unused fields and functions in the memory queue (elastic#31302) [libbeat] Cleaning up some unneeded helper types (elastic#31290) Readme for kibana module (elastic#31276) [Automation] Update elastic stack version to 8.3.0-4be61f32 for testing (elastic#31296) x-pack/winlogbeat/module/routing/ingest: fix typo for channel name (elastic#31291) Small pipeline cleanup removing some unused data fields (elastic#31288) removing info log (elastic#30971) Simplify TLS config deserialization (elastic#31168) Detect new files under known paths in filestream input (elastic#31268) Add support for port mapping in docker hints (elastic#31243) Update qa-labels.yml (elastic#31260) libbeat: log debug for `proxy_url` and fixed docs (elastic#31130) [heartbeat][docs] Add note about ensuring correct index settings for uptime (elastic#31146) [Automation] Update elastic stack version to 8.3.0-2c8f9574 for testing (elastic#31256) [Filebeat] fix m365_defender pipeline bug (elastic#31227) ...
…lastic#31254) This change relaxes the RFC3164 timestamp grammar to allow dates with a leading zero to be parsed as valid syslog timestamps, bringing the parser's behaviour into line with the parser in filebeat/input/syslog.
…31254) This change relaxes the RFC3164 timestamp grammar to allow dates with a leading zero to be parsed as valid syslog timestamps, bringing the parser's behaviour into line with the parser in filebeat/input/syslog.
What does this PR do?
This change relaxes the RFC3164 timestamp grammar to allow dates with a leading
zero to be parsed as valid syslog timestamps, bringing the parser's behaviour into
line with the parser in filebeat/input/syslog.
Why is it important?
There are non-standard syslog generating implementations that we were previously unable to consume. With this change we also gain the possibility of reducing the number of syslog parser implementations that we have.
Checklist
I have commented my code, particularly in hard-to-understand areasI have made corresponding changes to the documentationI have made corresponding change to the default configuration filesCHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.Author's Checklist
How to test this PR locally
go test github.com/elastic/beats/v7/libbeat/reader/syslog
Related issues
Use cases
Screenshots
Logs