So we are using Loki/Grafana to collect logs from our Kubernetes cluster, and the tool is great for that. But now that I have cleaned up the logs, I would also like to visualize them!
Selecting only JSON lines
# My query {namespace="default",pod=~"kkds-dockerscanner-test.+"} |= "SchemaVersion" | json
My logs
I select only two columns that I want to display in a table
{namespace="default",pod=~"kkds-dockerscanner-test.+"} |= "SchemaVersion" | json | line_format "{{.ArtifactName}} {{.Metadata_OS_Family}}"
Now I want to show the results in a table, but Grafana doesn't quite show the table I want. I want to show the output of my query in a table, and not just my output as a string in a column. Do you have any suggestions how to make this work, or can you point to a tutorial?
|json
works for me for identifying the labels. However, as far as I understand you, you want (some) labels to be shown as columns, right? – Ize