-
Notifications
You must be signed in to change notification settings - Fork 64
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
parse_logfmt adds extra fields #725
Comments
I had a look into this, and agree it doesn't seem like the correct behavior. I'd be interested in trying to fix it, so far I've found that vrl itself defines the parse_logfmt function in its own stdlib in the vrl repo EDIT: and the meat of it is actually in a key value parser written in nom |
I found perhaps the most minimal example VRL playground:
will output {
"\\\"": true,
"a": "\"1",
"message": "a=\"1 \\\""
} |
I've got a reproduction in a simple local project with just the relevant nom parsers copied across and vector dependencies removed. As far as I can tell it's caused by the standalone key option, when that's true something goes a bit awry in the parsing. |
no longer accepts empty keys!
no longer accepts empty keys!
no longer accepts empty keys!
A note for the community
Problem
I use parse_logfmt and I get field which I didn't expect to get.
in the following link you can see "\t\t"": true in the output. This field should be part of errorVerbose value, it should be standalone field.
https://playground.vrl.dev/?state=eyJwcm9ncmFtIjoibG9nLCBlcnIgID0gIHBhcnNlX2xvZ2ZtdCgubWVzc2FnZSlcbi4gPSBtZXJnZSguLCBsb2cpIiwiZXZlbnQiOnsibWVzc2FnZSI6ImxldmVsPWVycm9yIGVycm9yVmVyYm9zZT1cImNhbm5vdCBcXHRcXHRcIiJ9LCJpc19qc29ubCI6ZmFsc2UsImVycm9yIjpudWxsfQ%3D%3D
but if I take one '' off I get a good output, without extra fields
https://playground.vrl.dev/?state=eyJwcm9ncmFtIjoibG9nLCBlcnIgID0gIHBhcnNlX2xvZ2ZtdCgubWVzc2FnZSlcbi4gPSBtZXJnZSguLCBsb2cpIiwiZXZlbnQiOnsibWVzc2FnZSI6ImxldmVsPWVycm9yIGVycm9yVmVyYm9zZT1cImNhbm5vdCBcdFxcdFwiIn0sImlzX2pzb25sIjpmYWxzZSwiZXJyb3IiOm51bGx9
I would expect to get errorVerbose value as one line value, without being split, for example:
{
"errorVerbose": "cannot \t\t",
"level": "error",
"message": "level=error errorVerbose="cannot \t\t""
}
I can see the extra fields is added when there is \x\y pattern inside the value in the input (x is a single character, y can be any string).
Thanks.
Configuration
No response
Version
0.24.1
Debug Output
No response
Example Data
No response
Additional Context
No response
References
No response
The text was updated successfully, but these errors were encountered: