0

I am new to Regex and I cannot solve this problem with all the tutorials I've found. Maybe you experts know how to solve it.

I have a logfile with timestamps at the beginning of each line. The log entries are separated trough double space lines \n\n like this:

[1.1.2020] Msg1
[1.1.2020] Still Msg1
[1.1.2020] Still Msg1
[1.1.2020] End of Msg1

[1.1.2020] Msg2

[1.1.2020] Msg3
[1.1.2020] End of Msg3

How can I get the log messages without the leading timestamp but preserve the multi-line information like this:

Msg1
Still Msg1
Still Msg1
End of Msg1

Msg2

Msg3
End of Msg3

The timestamps are always the same for one log entry. I would need to store one timestamp of each message into a Named Group, so I can work later with it.

Thank you!

  • Either use two expressions (one for a block and one for each line) or a parser altogether. Please also tag the programming language in question. – Jan Apr 28 '20 at 14:43
  • How can I achieve this? Fluent-bit allows me just one expression. – drbugfinder Apr 29 '20 at 10:20

0 Answers0