Skip to content

Conversation

@kkania-splunk
Copy link
Contributor

issue caused by incorrect handling of syslog header, removed "-" from rfc5424 + refactoring
previously it was:
(?:(\d{4}[-]\d{2}[-]\d{2}[T]\d{2}[:]\d{2}[:]\d{2}(?:\.\d{1,6})?(?:[+-]\d{2}[:]\d{2}|Z)?)|-)\s(?:([\w][\w\d\.@-]*)|-)\s(.*)$
now it is:
(?:(\d{4}[-]\d{2}[-]\d{2}[T]\d{2}[:]\d{2}[:]\d{2}(?:\.\d{1,6})?(?:[+-]\d{2}[:]\d{2}|Z)?))\s(?:([\w][\w\d\.@-]*)|-)\s(.*)$
it's hot fix, in long term we should have more universal solution

from collections import OrderedDict


supported_headers = OrderedDict(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need an ordered dict here, why not just dict?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just to have a control which format is checked first, ofc ideally it shouldn't matter. It's a tricky part, I think we're not using any official or recommended regex here and preferably we should have some better solution here

@kkania-splunk kkania-splunk merged commit 703355b into main Dec 7, 2022
@kkania-splunk kkania-splunk deleted the fix/syslog-header-parser branch December 7, 2022 11:29
@github-actions github-actions bot locked and limited conversation to collaborators Dec 7, 2022
@srv-rr-github-token
Copy link
Contributor

🎉 This PR is included in version 4.1.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants