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

encode_logfmt mishandles "=" #17855

Closed
grinapo opened this issue Jul 4, 2023 · 1 comment · Fixed by vectordotdev/vrl#294
Closed

encode_logfmt mishandles "=" #17855

grinapo opened this issue Jul 4, 2023 · 1 comment · Fixed by vectordotdev/vrl#294
Labels
type: bug A code related bug.

Comments

@grinapo
Copy link

grinapo commented Jul 4, 2023

A note for the community

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Problem

I'm not sure whether there is a specification for logfmt, but clearly vector and loki have different mental images about equal signs. This page seems to be a fair representation of both what I'd accept and what's possibly used by loki.

Problem:

$ encode_logfmt({"a":"= ", "b":"="})
"a=\"= \" b=="

(a) contains a space, so it gets properly escaped.
(b) contains an equal sign and it should be escaped.

But maybe I'm wrong, and the quoted page overspecifies the format. Still, it feels wrong not to quote '=' sign, and it indeed looks wrong.

Configuration

No response

Version

vector 0.30.0 (x86_64-unknown-linux-gnu 38c3f0b 2023-05-22 17:38:48.655488673)

Debug Output

No response

Example Data

No response

Additional Context

No response

References

No response

@dsmith3197
Copy link
Contributor

Hi @grinapo,

Thanks for providing all the necessary context. I went ahead an created a fix PR as it was a quick one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A code related bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants