1. Describe your incident:
I use winlogbeat to ingest Windows Defender Security Event to Graylog. The message field is not parsed correctly as it does not get all the data.
I would like to parse it with the key/value pipeline but it give me some weird result:
- The message looks like this:
{
"tags": [
"windowsdefender"
],
"message": "Antivirus Microsoft Defender a détecté un logiciel malveillant ou potentiellement indésirable.\n Pour plus d’informations, reportez-vous aux éléments suivants :\nhttps://go.microsoft.com/fwlink/?linkid=37020&name=Virus:DOS/EICAR_Test_File&threatid=2147519003&enterprise=0\n \tNom : Virus:DOS/EICAR_Test_File\n \tID : 2147519003\n \tGravité : Grave\n \tCatégorie : Virus\n \tChemin : containerfile:_C:\\Users\\adm.user\\Downloads\\eicar_com.zip; file:_C:\\Users\\adm.user\\Downloads\\eicar_com.zip->eicar.com; webfile:_C:\\Users\\adm.user\\Downloads\\eicar_com.zip|https://secure.eicar.org/eicar_com.zip|pid:1352,ProcessStart:133385545470169081\n \tOrigine de la détection : Internet\n \tType de détection : Concret\n \tSource de détection : Téléchargements et pièces jointes\n \tUtilisateur : LAB\\adm.user\n \tNom du processus : Unknown\n \tVersion de la veille de sécurité : AV: 1.397.528.0, AS: 1.397.528.0, NIS: 1.397.528.0\n \tVersion du moteur : AM: 1.1.23080.2005, NIS: 1.1.23080.2005"
}
And i want to extract all the field starting from \n \tNom :
-
Where
\n \t
is the delimiter, -
:
is the separator -
as there is space before and after the separator, I tried many things but nothing work
-
The pipeline rule:
when
contains(to_string($message.tags),"windowsdefender")
then
set_fields(
fields:
key_value(
value: to_string($message.message),
trim_value_chars: " ",
trim_key_chars:" ",
delimiters:"\\n \\t",
kv_delimiters:":"
)
);
end
Here’s the result…
(EventDescription comes from another pipeline)
The trace logs of the simulations shows no errors.
2. Describe your environment:
-
OS Information: docker
-
Package Version: Graylog 5.1.4 / Opensearch 2.9.0
3. What steps have you already taken to try and solve the problem?
I already try to set the space in the trim or in separator but does not change the problem.
4. How can the community help?
Is it possible to set return carriage and tabulation as separator for this case ?