Format event and Parser File
Greetings community!
We are now receiving events from the Kaspersky cloud in FortiSIEM, where the format is a "System Log", and it has the following structure, for example:
<14>1 2025-04-15T12:50:06.047Z | - TEST_SIEM_CONNECTION [event@23668 et="TEST_SIEM_CONNECTION" etdn="Test Siem Connection"]
<14>1 2025-04-15T01:34:49.000Z xxx_hostedinst_xxxxx.openstacklocal 1093|1.0.0.0 - KLAUD_EV_SERVERCONNECT [event@23668 p2="x.x.x.x" p3="2x\\xx" p5="x.x.x.x" p9="::1" et="KLAUD_EV_SERVERCONNECT" etdn="Audit (connection to the Administration Server)" hdn="<xxxx>" hip="x.x.x.x" gn="Managed devices" kscfqdn="xxx.openstacklocal"] User "2xxx" has connected to the Administration Server from "x.x.x.x".
As a result, the events are arriving as "Unknow_events", precisely because there is no parser for this type of log. I created a new parser file at this first moment just to test the simplest events, for example: <14>1 2025-04-15T12:50:06.047Z | - TEST_SIEM_CONNECTION [event@23668 et="TEST_SIEM_CONNECTION" etdn="Test Siem Connection"].
The contents of the parser.xml below:
<eventFormatRecognizer>
<![CDATA[TEST_SIEM_CONNECTION]]>
</eventFormatRecognizer>
<patternDefinitions>
<pattern name="patTimestamp"><![CDATA[\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z]]></pattern>
<pattern name="patWord"><![CDATA[\S+]]></pattern>
<pattern name="patQuotedString"><![CDATA[[^"]+]]></pattern>
</patternDefinitions>
<collectFieldsByRegex src="$_rawmsg">
<regex>
<![CDATA[<\d+>1\s+(?P<deviceReceiptTime>\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z)\s+\|\s+-\s+(?P<eventType>\S+)\s+\[event@\d+\s+et="(?P<et>[^"]+)"\s+etdn="(?P<etdn>[^"]+)"\]]]>
</regex>
</collectFieldsByRegex>
<parsingInstructions>
<setEventAttribute attr="eventType">Kaspersky-TEST_SIEM_CONNECTION</setEventAttribute>
<setEventAttribute attr="eventSeverity">1</setEventAttribute>
<setEventAttribute attr="msg">$etdn</setEventAttribute>
</parsingInstructions>
I made sure that the content of the xml parser was ok, and I also validated both the regex in the python script and in regex101, to make sure that all the parameters of this event were matching as shown below:
When I perform the parser test on Fortisiem itself to enable it, an error occurs, and the reason for this is not reported.
Does anyone have any idea why this is happening? Or any other strategy to address this issue, either in the GUI or by accessing one of the Fortisiem components. Any help is welcome. Thanks