Problem with custom timestamp

I have a problem with the conversion of custom timestamps. I use a regular expression to parse the logs and append three labels and a format line. Once all programs are started, I see in Loki all labels parsed correctly, but no data. A query over a label from the list also returns no results: “No data”.

To Reproduce: I start the programms with docker-compose:

version: “3”
networks:
loki:
services:
loki:
image: grafana/loki:2.2.0
ports:

  • “3100:3100”
    volumes:
  • ./Loki/loki-config.yml://etc/loki/local-config.yaml
    command: -config.file=/etc/loki/local-config.yaml
    networks:
  • loki

promtail:
image: grafana/promtail:2.2.0
ports:

  • “9080:9080”
    volumes:
  • /var/log:/var/log
  • ./logs:/var/log/dav
  • ./Promtail/promtail_dav.yml:/etc/promtail/config.yml
    command: -config.file=/etc/promtail/config.yml
    networks:
  • loki

grafana:
image: grafana/grafana:latest
ports:

  • “3000:3000”
    networks:
  • loki
    volumes:
  • grafana-loki-storage:/var/lib/grafana

volumes:
grafana-loki-storage:
external: true

Expected behavior:
Timestamps are taken from logs and displayed in Loki as entry time instead of the time of receipt of logs.

Promtail config:

Log Example:

#170 18.02.2021 06:57:03,862:+0200 (TID:000001) … KONFIG : ConfigurationApp.de.bsvrz.puk.config.configFile.fileaccess.ConfigFileHeaderInfo

#171 18.02.2021 06:57:04,865:+0200 (TID:000001) ---------------------- INFO : ConfigurationApp.de.bsvrz.puk.config.configFile.fileaccess.ConfigAreaFile Laden der Konfigurationsdatei: /bet/vba_a81/kernsoftware-3.8.0/kv.aoe.bw.uz.A81.sba_stgt/konfiguration/kb.objekte.Zlt.A81.sba_stgt.config

Screenshot after start:

Thanks a lot for your help!

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.