I’m setting up new logs management for an application with Graylog.
Logs are sent to Graylog using an UdpAppender on the application log4net.config file.
A specific input was created te receive these messages, and there are well received.
Now, I would like to add an extractor to extract information from a message but a simple regex doesn’t match.
Message example: 2022-08-23 11:57:17,925 | INFO | Operation | MY-HOST-NAME-001 | Message Text
Simple regex that doesn’t match (I know my regex is stupid but it is just to show you the issue): .*(INFO).*
But the following regex is matching (that suppose there is unvisible chars between each letter of the message): .*(I\SN\SF\SO).*
And if I try to add the message to a query using “Add to query” feature, I have the following behaviour:
There is unwanted chars between each letters of the message.
Do you think that this behaviour is coming from the application log4net.config file or from Graylog itself?
Do you already had this kind of issue and how did you solve it?
rule "fields"
when
true
then
let m = split("\\|", to_string($message.message));
set_field("datetime", m[0]);
set_field("info", m[1]);
set_field("ops", m[2]);
set_field("hosts", m[3]);
set_field("mgms", m[4]);
end