Parsing custom timestamp/format

Hello,

I would like to parse a custom timestamp but can’t find any example… Maybe someone here can help me out with my problem. The main thing is, there is a new logfile generated every day. No date per line, only time per each line:

The logfile looks like this:

##############################################################################################
10/20/2022
##############################################################################################
10:52:30 AM.583 LOGLINE FOO BAR GNA1
12:26:22 PM.705 LOGLINE FOO BAR GNA2
...

My regex for the line looks like this:
(?P^\d{1,2}:\d{2}:\d{1,2} (?:AM|PM))

How should my promtail config look like to get the right time in loki?

Regards
SchiSchi

I am not sure how you would be able to do this as is. If the file is generated per day, any reason you can’t just add another step to it and just append the date from second line to all lines in the file?

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