Hi all...
I'm currently trying to wrangle fluent-bit into parsing the log format produced by a framework we're using (4Js Genero, if anyone is familiar with it). The format looks something like this:
Date: 02/09/2021 Time: 17:09:57
Hello world!
Date: 02/09/2021 Time: 17:09:58
Program error at 'main.4gl', line number 8.
SQL statement error number -1803 (-1).
Connection does not exist.
i.e. a standard line for the date/time, followed by one or more lines of freeform text.
I'm using the following definition for Parser_FirstLine:
[PARSER]
Name log-first-line
Format regex
Regex ^(?<datetime>Date: \d{2}\/\d{2}\/\d{4}\s+Time: \d{2}\:\d{2}:\d{2})(?<content>.*)
Time_Key datetime
Time_Format Date: %d/%m/%Y Time: %H:%M:%S
Time_Keep on
...and this is producing the following:
{"date":1630602597.0,"path":"test.err","datetime":"Date: 02/09/2021 Time: 17:09:57\nHello world!"}
{"date":1630602598.0,"path":"test.err","datetime":"Date: 02/09/2021 Time: 17:09:58\nProgram error at 'main.4gl', line number 8.\nSQL statement error number -1803 (-1).\nConnection does not exist."}