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

fix json expression parser #9410

Merged
merged 2 commits into from
May 5, 2023

Conversation

MasslessParticle
Copy link
Contributor

When the value parsed by the JsonExpressionParser is an escaped json string, the result still contains escape character and may not be valid json. This causes subsequent json parsing steps to fail. For example:

{app="foo"} | json message | line_format "{{.message}}" | json fails when message remains escaped.

This PR unescapes the results of extracted JsonExpressions so they can be parsed by subsequent json parsers

Copy link
Contributor

@dannykopping dannykopping left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@MasslessParticle MasslessParticle merged commit 48ad068 into main May 5, 2023
@MasslessParticle MasslessParticle deleted the tpatterson/fix-json-expression-parser branch May 5, 2023 20:04
MasslessParticle added a commit that referenced this pull request May 5, 2023
When the value parsed by the `JsonExpressionParser` is an escaped json
string, the result still contains escape character and may not be valid
json. This causes subsequent json parsing steps to fail. For example:

`{app="foo"} | json message | line_format "{{.message}}" | json` fails
when `message` remains escaped.

This PR unescapes the results of extracted `JsonExpressions` so they can
be parsed by subsequent json parsers
@chaudum chaudum added the type/bug Somehing is not working as expected label Jun 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/S type/bug Somehing is not working as expected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants