I use the PLG stack (promtail, loki, grafana) to collect system logs and I need to override the integration date added by loki by the one extracted from the log message,
I can't get it to work, here is my example:
scrape_configs:
- job_name: "service-0 "
static_configs:
- targets:
- localhost
labels:
service: service -0
host: " service-0-xyz.local "
timestamp:
environment: "dev"
__path__: /etc/sys.log
pipeline_stages:
- match:
selector: '{service="service -0"}'
stages:
- regex:
expression: '(?P<timestamp>^(^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}))'
- timestamp:
source: timestamp
format: RFC3339Nano
- labels:
'timestamp:
Do you have an example please?
thanks for your help
I've tried updating loki/promtail to last version,
I've added new field named "timestamp" filled by extracted date from log message, but i can't change the integration date
I found this discussion, but I can't make it work