Dear Luiz,
I have prepared the below decoder for you. I need to remark that I have processed your log as a single line.
In your sample log, there are different lines, I would need a single-line sample log to make the decoder accurate.
Please make sure you share the log exactly as you receive it in the log file.
In case your log is multi-line we would need to make some adjustments.
You can follow the below steps for one-liner log decoding:
1) I created
ArubaClearpass.xml under folder /var/ossec/etc/decoders
[root@wazuh-manager decoders]# vi ArubaClearpass.xml
>>> paste following contents <<<
<!--SAMPLE LOG:
10:41:51.105848 IP 10.1.200.205.48015 > 10.1.1.198.514: SYSLOG local0.debug, length: 529E..-'.@.@.3)..............<135>2024-03-07 10:41:51,99 10.1.200.205 Syslog 2185593 1 0 Common.Username=
x...@gmail.com,Common.Service=SVC-WLAN-PORTAL_MAC-AUTH,Common.Roles=RL-VISITANTE, [User Authenticated],RADIUS.Auth-Source=Local:localhost,RADIUS.Auth-Method=MAC-AUTH,Common.System-Posture-Token=UNKNOWN,Common.Enforcement-Profiles=PRF-ACCESS_VISITANTE, PRF-UPDATE_ENDPOINT_USERNAME, PRF-SESSION_TIMEOUT-24Hrs,Common.Host-MAC-Address=1234aae94e6a,Common.NAS-IP-Address=10.10.254.60,Common.Error-Code=0,Common.Request-Timestamp=2024-03-07 10:41:46-03
-->
<decoder name="ArubaClearpass">
<prematch>^\d+:\d+:\d+.\d+ IP</prematch>
</decoder>
<decoder name="ArubaClearpass_child">
<parent>ArubaClearpass</parent>
<regex>^\d+:\d+:\d+.\d+ IP (\d+.\d+.\d+.\d+).\d+ > (\d+.\d+.\d+.\d+).\d+: SYSLOG</regex>
<order>log.source.ip, log.destination.ip</order>
</decoder>
>>> save and quit <<<
2) Including the sample log in the same decoder file, is a good practice. That way you can watch the sample log while building the decoder part by part.
3) In the provided decoder we are capturing the fields inside (), which in this case are log.source.ip and log.destination.ip
You can capture more data by adding more () in the "regex" and adding new fields in the "order" section.
5) This is how decoding looks when using /var/ossec/bin/wazuh-logtest tool:
[root@wazuh-manager decoders]# /var/ossec/bin/wazuh-logtest
Starting wazuh-logtest v4.7.2
Type one log per line
10:41:51.105848 IP 10.1.200.205.48015 > 10.1.1.198.514: SYSLOG local0.debug, length: 529E..-'.@.@.3)..............<135>2024-03-07 10:41:51,99 10.1.200.205 Syslog 2185593 1 0 Common.Username=
x...@gmail.com,Common.Service=SVC-WLAN-PORTAL_MAC-AUTH,Common.Roles=RL-VISITANTE, [User Authenticated],RADIUS.Auth-Source=Local:localhost,RADIUS.Auth-Method=MAC-AUTH,Common.System-Posture-Token=UNKNOWN,Common.Enforcement-Profiles=PRF-ACCESS_VISITANTE, PRF-UPDATE_ENDPOINT_USERNAME, PRF-SESSION_TIMEOUT-24Hrs,Common.Host-MAC-Address=1234aae94e6a,Common.NAS-IP-Address=10.10.254.60,Common.Error-Code=0,Common.Request-Timestamp=2024-03-07 10:41:46-03
**Phase 1: Completed pre-decoding. full event: '10:41:51.105848 IP 10.1.200.205.48015 > 10.1.1.198.514: SYSLOG local0.debug, length: 529E..-'.@.@.3)..............<135>2024-03-07 10:41:51,99 10.1.200.205 Syslog 2185593 1 0 Common.Username=
x...@gmail.com,Common.Service=SVC-WLAN-PORTAL_MAC-AUTH,Common.Roles=RL-VISITANTE, [User Authenticated],RADIUS.Auth-Source=Local:localhost,RADIUS.Auth-Method=MAC-AUTH,Common.System-Posture-Token=UNKNOWN,Common.Enforcement-Profiles=PRF-ACCESS_VISITANTE, PRF-UPDATE_ENDPOINT_USERNAME, PRF-SESSION_TIMEOUT-24Hrs,Common.Host-MAC-Address=1234aae94e6a,Common.NAS-IP-Address=10.10.254.60,Common.Error-Code=0,Common.Request-Timestamp=2024-03-07 10:41:46-03'
**Phase 2: Completed decoding. name: 'ArubaClearpass'
log.destination.ip: '10.1.1.198'
log.source.ip: '10.1.200.205'**Phase 3: Completed filtering (rules).
id: '1002'
level: '2'
description: 'Unknown problem somewhere in the system.'
groups: '['syslog', 'errors']'
firedtimes: '1'
gpg13: '['4.3']'
mail: 'False'
^C
[root@wazuh-manager decoders]#
I hope you find this useful, do not hesitate to ping us again if extra help is needed... we are always happy to help.
Regards,
[Wazuh] Diego.-