I want to capture Postgresql logs with Promtail and display them with Loki in Grafana.
I have seen many screenshots on the internet sharing that the warning info debug error logs were colored by Loki. However, I could not color them in Loki.
Although there is an error in the log below, I could not show an error in the label in the gui.
Can you guide me? Where do I need to fix or configure?
–here is config yaml for promtail
scrape_configs:
- job_name: system
static_configs:
- targets:
- localhost
labels:
job: express_120
__path__: /u01/pgdata/15/data/log/*.log
pipeline_stages:
- multiline:
firstline: '^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{3} CET'
- regex:
expression: '(?P<time>^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}.\d{3}) \[(?P<level>[A-Z]+)\]? (?P<msg>(.|\n)*$)'
- labels:
time:
level:
trace:
- timestamp:
source: time
format: '2006-01-02 15:04:05.000'
- output:
source: msg