Why is the `json` parser failing?

I’m using a default installation of the Loki Stack on Kubernetes (no added processing). I get logs like this from a pod:

{"level":"debug","msg":"listing project pipelines","project-name":"my-group/project-a","ref":"master","time":"2021-06-03T08:45:59Z"}
{"level":"debug","msg":"could not find any pipeline for the ref","project-name":"my-group/project-a","ref":"master","ref-kind":"branch","time":"2021-06-03T08:45:59Z"}
{"level":"debug","msg":"listing project pipelines","project-name":"my-group/project-b","ref":"master","time":"2021-06-03T08:45:59Z"}
{"level":"debug","msg":"could not find any pipeline for the ref","project-name":"my-group/project-b","ref":"master","ref-kind":"branch","time":"2021-06-03T08:45:59Z"}

I can follow these live without problems in Loki, but I can’t parse them as JSON:

All of them show JSONParserErr under __error__. Am I missing something?

Hey @shivjm

If you look closely, all your logs are starting with stdout F - this is why the JSON parsing is failing.
You should enable the CRI pipeline stage so these lines can be correctly parsed from docker: Configuration | Grafana Labs

1 Like

Ah, I didn’t realize that was part of the message! I thought it was something being added for display. Thank you, I’ll try adding the cri stage.