Parse Json Logs w Loki, Promtail
{"level":"info","time":"2021-08-16T18:26:46.621Z","name":"bme280.data","msg":"data","temperature":26.03,"pressure":999.39,"humidity":45.32,"altitude":116}
I used following promtail config:
scrape_configs:
- job_name: kubernetes-pods-name
pipeline_stages:
- json:
expressions:
altitude: altitude
humidity: humidity
level: level
output: msg
pressure: pressure
temperature: temperature
timestamp: time
- labels:
level: null
- timestamp:
format: RFC3339
source: timestamp
- output:
source: output
kubernetes_sd_configs:
- role: pod
#I was hoping that simply by defining the JSON parsing and labels I get to see these labels in the Grafana Explore. I do see the log entries in Grafana as shown below, but I don’t see any labels that are part of the JSON keys.
DreamCoder