Dear folks,
I am creating a custom decoder for syslog messages generated by an OLT, and i'm having issues with a log with extra colons;
wazuh-logtestJul 16 14:15:45 OLT_01-PF : 1/1 : <Info> %AAA-USER_SESSION_STOP : aaa-app[4562] : User [admin]: Closed session ID 684388the event reaches Phase 1 correctly, but no decoder matches, even though the decoder only contains a simple prematch.
Phase 1:
**Phase 1: Completed pre-decoding.
full event: 'Jul 16 14:15:45 OLT_01-PF : 1/1 : <Info> %AAA-USER_SESSION_STOP : aaa-app[4562] : User [admin]: Closed session ID 684388'
timestamp: 'Jul 16 14:15:45'
hostname: 'OLT_01-PF'
program_name: ''Phase 2:
**Phase 2: Completed decoding.
No decoder matched.
Example Decoder:<decoder name="olt-gpon">
<prematch type="pcre2">AAA-USER_SESSION_STOP</prematch>
</decoder>
<decoder name="olt-gpon-child">
<parent>olt-gpon</parent>
<regex type="pcre2">Info</regex>
<order>event.severity</order>
</decoder>
<decoder name="olt-gpon-child">
<parent>olt-gpon</parent>
<regex type="pcre2">User\s+\[([^\]]+)\]</regex>
<order>user</order>
</decoder>The prematch is intentionally minimal, so I would expect the parent decoder to match regardless of the remaining message structure.
Testing:
If I remove only the colon immediately after the hostname, changing the message to:
Jul 16 14:15:45 OLT_01-PF 1/1 : <Info> %AAA-USER_SESSION_STOP : aaa-app[4562] : User [admin]: Closed session ID 684388The decoder works perfectly.
Phase 1:
**Phase 1: Completed pre-decoding.
full event: 'Jul 16 14:15:45 OLT_01-PF 1/1 : <Info> %AAA-USER_SESSION_STOP : aaa-app[4562] : User [admin]: Closed session ID 684388'
timestamp: 'Jul 16 14:15:45'
hostname: 'OLT_01-PF'Phase 2:
**Phase 2: Completed decoding.
name: 'olt-gpon'
dstuser: 'admin'The only difference between both logs is the extra colon after the hostname.
Is normalizing this log with an external syslog the only way to parse?
Many thanks!