How to add timestamp from log line instead of default timestamp

I have log lines in the format:
06/15/2022-17:44:06:754 - WARN - AppiaExecProcessor.java:272 - processExecution: ClOrdID=null took 3 ms
06/15/2022-17:28:55:481 - WARN - AppiaExecProcessor.java:272 - processExecution: ClOrdID=A_CAN1655328057070:320785908OHPR2C took 4 ms
How can I configure promtail YAML file to read the timestamp at beginning of log-line instead of default timestamp?
The scrape-configs of the promtail yaml file looks like this:

scrape_configs:

  • job_name: system
    pipeline_stages:
    • regex:
      expression: ā€œ.{0,23}ā€
    • timestamp:
      source: time
      format: 06/15/2022-18:21:57:173
      static_configs:
    • targets:
      • localhost
        labels:
        job: varlogs
        path: C:\Users\sb\Downloads\loki\logs\logfile.log
2 Likes

Did you figure this out? Iā€™m trying to do the same thing

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