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.
Consider the following code :
It generates the following output:
Where it should be generating this:
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.