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

parse_json in VRL doesn't support json-like strings (with single quotes) #1244

Open
nomalord opened this issue Jan 30, 2025 · 0 comments
Open
Labels
type: bug A code related bug

Comments

@nomalord
Copy link

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 have encountered an issue with parsing json strings with single quotes:
the following VRL expression:

.bad = parse_json!(.bad)

parsing the following event:

{
    bad: "{'test': 'hello'}"
}

returns an error saying the json is invalid...

I also tested in the VRL playground
Please help :)
Thanks in advance

https://playground.vrl.dev/?state=eyJwcm9ncmFtIjoiLmJhZCA9IHBhcnNlX2pzb24hKC5iYWQpIiwiZXZlbnQiOm51bGwsImlzX2pzb25sIjpmYWxzZSwiZXJyb3IiOiJDb3VsZCBub3QgcGFyc2UgSlNPTiBldmVudDpcbntcbiAgICBiYWQ6IFwieyd0ZXN0JzogJ2hlbGxvJ31cIlxufSJ9

Configuration


Version

0.38

Debug Output


Example Data

No response

Additional Context

No response

References

No response

@nomalord nomalord added the type: bug A code related bug label Jan 30, 2025
@pront pront transferred this issue from vectordotdev/vector Jan 30, 2025
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

No branches or pull requests

1 participant