A question to those using Grafana to display Loki logs.

I'm displaying my Kubernetes pod/container logs in the Grafana Log panel. I'm adding the Kubernetes pod labels to each log line. This makes the log lines pretty busy and I have to scan them visually to find the actual log message.

Is there a way to tell tell in the Loki query or the Grafana panel config to drop some keys from the log line completely, so I only end up with the actual log content?

1/2

#HomeLab #GrafanaLoki

I already know about the line_format function, but the issue is: I'm showing logs from e.g. an entire namespace at the same time. So I can't assume that all the log lines have the same keys after logfmt.

That's why I'd like a function to exclude certain common log line keys from getting displayed, but I wasn't able to do it.

Does anybody have any good idea?

2/2

#HomeLab #GrafanaLoki