I’m new to PLG stack so please excuse any ignorance. I am running k8 and I have “Loki-Stack” (all defaults) helm chart deployed in my EKS cluster.
My logs are already in JSON format, however none of the underlying fields are being parsed as “Log Labels”. When I try to pass the logs through the json pipeline, I still don’t see the labels being extracted. I do not see any errors in the UI saying my JSON is malformed or anything like that.
Here is an example:
Log line as it appears in Query Explorer
“{“log”:{“level”:“warn”,“logger”:“pino”},”@timestamp":“2021-02-15T14:56:51.487Z”,“process”:{“pid”:17},“host”:{“hostname”:“graphql-api-54589bd4cf-frhvd”},“error”:{“name”:“UnauthorizedError”,“message”:“No authorization token was found”,“code”:“credentials_required”,“status”:401,“inner”:{“message”:“No authorization token was found”}},“ecs”:{“version”:“1.5.0”},“message”:“Auth Error”} "
I would like the underlying fields in my JSON to be defined as “Log Labels” so I can query against them more effectively.
After doing extensive research it seems the expected behavior is for this JSON object to be flattened and it’s fields parsed out in the log labels section.
Hey Mr. Welch! I promise I have tried this time and time again, but it seems like no labels are being extracted and my json is not being flattened as it says in the docs. In fact, nothing is happening. See attached snippets of when i add that in my query and execute and what the log line looks like afterward. Nothing changes
Solution for anyone else who may run into this issue:
The loki-stack helm chart uses version/image tag 6.7.0 by default. This image does not contain the features detailed in many of the new docs and videos.
Use the following command to deploy the loki-stack with the latest version of Grafana (per docker)
helm upgrade --install loki grafana/loki-stack --namespace=loki --set grafana.enabled=true --set grafana.image.tag=7.4.3 (or whatever version you would like)