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

dashboard vars, extract field values from json content #226

Open
dginhoux opened this issue Jan 30, 2025 · 1 comment
Open

dashboard vars, extract field values from json content #226

dginhoux opened this issue Jan 30, 2025 · 1 comment

Comments

@dginhoux
Copy link

dginhoux commented Jan 30, 2025

Hi,

I'm ingesting traefik json logs in json format. And i want to create a dashboard with a var list with a field in json (RequestAddr).
So, i create a var with the following config and query :

Image

But i it return the full _msg content... i don't understand how get this value.

Json sample :

Image

Can you help me ?

@tiny-pangolin
Copy link
Contributor

I do not believe it is possible for the logs datasource to detect generated fields from the unpack_json pipe. Would it be possible for you to parse the json using a something like telegraf or vector so RequestAddr shows up as other field when it is ingested?

As an example this the telegraf configuration I'm using to parse Traefik logs from docker before shipping them to Victorialogs

The other benefit to parsing the logs at ingestion time instead of query time is the queries will complete faster and use fewer resources since Victorialogs isn't parsing the logs every time the dashboard loads.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants