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

Failure to parse escaped double-quotes inside SD values #12

Open
ChezBunch opened this issue May 6, 2021 · 0 comments
Open

Failure to parse escaped double-quotes inside SD values #12

ChezBunch opened this issue May 6, 2021 · 0 comments

Comments

@ChezBunch
Copy link

Consider the following code :

const parser = require("nsyslog-parser");
console.log(parser('<15>1 2021-05-06T08:02:30.282938Z host APP 1000 l [c q="x"]').structuredData);
console.log(parser('<15>1 2021-05-06T08:02:30.282938Z host APP 1000 l [c q="\\""]').structuredData);

It generates the following output:

[ { '$id': 'c@0', q: 'x' } ]
[]

Where it should be generating this:

[ { '$id': 'c@0', q: 'x' } ]
[ { '$id': 'c@0', q: '"' } ]

The RFC5424 states that :
Inside PARAM-VALUE, the characters '"' (ABNF %d34), '\' (ABNF %d92), and ']' (ABNF %d93) MUST be escaped.

Nevertheless, the parsing does not seem to properly parse escaped double-quotes inside SD values.

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

1 participant