-
Notifications
You must be signed in to change notification settings - Fork 78
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
Vector does not parse RFC5424 structured data with some escape characters #228
Comments
I'm not quite sure I understand the problem. With the example data provided this field: Properly escaped should look like: This does parse: $ parse_syslog!(s'<165>1 2022-09-22T13:07:54.228490+00:00 server1 api 12345 - [exampleSD1@66851 field1="example" field2="331" field3="618"][meta@123 field4="123" example_field="\"Hello\" /World"] 10.0.0.1 - - [22/Sep/2022:13:07:54 +0000] "GET /api/events"')."meta@123.example_field"
"\"Hello\" /World" You say that Can you give an example of some unescaped values together with the text containing the escapes so we can see what the problem is? |
I made a mistake with setting up the problem and the example data, so I am sorry about this. Here is the proper example data:
With this, we get output
But, if we remove this backslash in front of character A
The problem is the SD meta is dropped completely when we have a backslash in SD param value present when there is no valid escape character, while other parts of RFC5424 syslog is parsed as expected and no warn or errors are raised during parsing. I didn't understand the problem enough at the time of writing to give a better title and explanation, I think this is more of an issue when should backslashes be treated as any other character. Thanks for the reply! |
Ok, yeah I see the issue. Looking at the RFC for Syslog it says:
Which we are not doing. I've raised an issue against our syslog parser library so it can be looked into. |
Hello, I'd like to share the workaround configuration for this particular problem with RFC5424 parsing that works for us currently:
For the given example data: we get
|
A note for the community
Problem
We've encountered some strange behaviors on VRL function
parse_syslog
, where it discards whole structured data elements if a structured data parameter in structured data contains escape characters (not for all, like\"
).When a structured data parameter contains escape character such as
\/
, it then discards whole structured data.I've tested this also with
vector vrl
and no errors come out, but the structured data with problematic parameter is discarded completely.Configuration
Version
vector 0.24.1 (x86_64-unknown-linux-gnu 8935681 2022-09-12)
Debug Output
Example Data
<165>1 2022-09-22T13:07:54.228490+00:00 server1 api 12345 - [exampleSD1@66851 field1="example" field2="331" field3="618"][meta@123 field4="123" example_field=""Hello" /World"] 10.0.0.1 - - [22/Sep/2022:13:07:54 +0000] "GET /api/events"
<165>1 2022-09-22T13:07:54.228490+00:00 server1 api 12345 - [exampleSD1@66851 field1="example" field2="331" field3="618"][meta@123 field4="123" example_field=""Hello" /World"] 10.0.0.1 - - [22/Sep/2022:13:07:54 +0000] "GET /api/events"
Additional Context
No response
References
No response
The text was updated successfully, but these errors were encountered: