I would like to pre-process following log structure with nxlog and send it then to graylog.
My custom app log structure:
timestamp;field1;field2; ---- Start of good event ----
timestamp;field3;field4;field5;field6
timestamp;field7;field8;field9;field10
timestamp;field11;field12; --- End of good event ---
timestamp;FAIL;field13;field14
timestamp;FAIL;field15;field16
The GELF output from nxlog should contain full_message with "good event" or "bad event".
"good event" = 1 line as follows:
timestamp;field1;field2; ---- Start of good event ----;timestamp;field3;field4;field5;field6;timestamp;field7;field8;field9;field10;timestamp;field11;field12; --- End of good event ---
"bad event" should contain 1 line as follows:
timestamp;FAIL;field13;field14; timestamp;FAIL;field15;field16
I have no problem to parse "good event" with xm_multiline and define it's HeaderLine and EndLine.
But I have absolutely no idea, how to parse two different multilines. Could you give me any hint, please?
Is it possible to use if-else statement with "InputType"? I mean "if condition1 then InputType good-event and some-actions else InputType bad-event and some-actions". Or it needs totally different approach - e.g. no xm_multiline usage but some kind of regex magic?
Thanks in advance.