I am running a basic install of loki-stack helm chart (Loki, Promtail, Grafana, Prometheus) with Asp.Net core services logging with serilog in json format (compactJsonFormatter), however, when I check in loki the logs aren’t parsed correctly:
I’m in a similar situation. I’m just starting to research Promtail pipeline_stages.
I would not expect those logs to just automagically be parsed by Loki. Looks like you have a mixed log format as well, which starts with a string and then there is a JSON object at the end.
I come from Elastic Stack and my expectation is that logs have to be parsed before they are stored but that is not necessarily true for Loki. You could parse your logs in Grafana if you want with LogQL.
First use pattern to get the JSON object separated. This you can pipe to json.
Here is an example of a LogQL query I have used to do something similar