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

Detect embedded JSON #16106

Open
baelter opened this issue Feb 5, 2025 · 0 comments
Open

Detect embedded JSON #16106

baelter opened this issue Feb 5, 2025 · 0 comments
Labels
type/feature Something new we should do

Comments

@baelter
Copy link

baelter commented Feb 5, 2025

Is your feature request related to a problem? Please describe.
We have log messages with mixed formats. logfmt and json, or plain text and json. I want to be able to use the json function and the "Prettify JSON" feature while keeping the entire log line. I can extract the json part, parse it and get it prettified, but not while preserving the rest of the log line. E.g.

my=mixed format=log line with:some {"embedded": "json"}
regexp (?P<json>\{.*\}) | line_format "{{.json}}" | json

>

{
  "embedded": "json"
}

Describe the solution you'd like

my=mixed format=log line with:some
{
  "embedded": "json"
}
  • The json LogQL function should find embedded json.
  • The "Prettify JSON" feature should find embedded json.

Describe alternatives you've considered
Using other log services.

Additional context
Expand/Collapse json embedded in log lines in Papertrail:
Image

@JStickler JStickler added the type/feature Something new we should do label Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/feature Something new we should do
Projects
None yet
Development

No branches or pull requests

2 participants