Skip to content

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

Open
@nomalord

Description

@nomalord

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugA code related bugvrl: stdlibChanges to the standard library

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions