Skip to content
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

RFC3164 should not provide structured data parsing #37

Open
itkovian opened this issue Sep 25, 2024 · 1 comment
Open

RFC3164 should not provide structured data parsing #37

itkovian opened this issue Sep 25, 2024 · 1 comment

Comments

@itkovian
Copy link

According the the RFC, the syslog line comprises the following "fields":

<PRI>TIMESTAMP HOSTNAME TAG: MESSAGE

Afaik, there is no mention of any structured data, yet the rfc3164 parser optionally provides support for this. This makes parsing log lines that adhere to rfc3164, but contain a [<text>] at the MESSAGE start impossible to parse correctly.

@StephenWakely
Copy link
Owner

StephenWakely commented Nov 7, 2024

This parser is not designed to conform exactly to the specs - hence the name loose. The problem is that not everything conforms to exactly 3164 or 5424. Looking at the tests here it looks like rsyslog produces 3164 messages - but also includes structured data. This parser was written with the aim to cater for what is out there rather than be exact.

Of course when you try to keep everyone happy problems such as this arise.

I think the best thing here is to be a bit stricter in the structured data parsing.

Currently if the structured data is invalid, with 3164 this is then treated as a part of the message. However structured data with just the id and no key value pairs is valid structured data. We should be a bit stricter and treat this is invalid for 3164.

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

No branches or pull requests

2 participants