Hello!
To achieve this, you need to modify the existing default decoders with the custom decoders.
To do this, SSH to your Wazuh Manager's server.
Copy the default decoder file to the custom decoder folder.
I am using 0375-web-accesslog_decoders.xml as an example.
cp /var/ossec/ruleset/decoders/0375-web-accesslog_decoders.xml /var/ossec/etc/decoders/local_web-accesslog_decoders.xml
Change file permission.
chmod 660 /var/ossec/etc/decoders/local_web-accesslog_decoders.xml
chown wazuh:wazuh /var/ossec/etc/decoders/local_web-accesslog_decoders.xml
Go to the manager’s ossec.conf
/var/ossec/etc/ossec.conf
Under the
<ruleset>
Add this line
<decoder_exclude>ruleset/decoders/0375-web-accesslog_decoders.xml</decoder_exclude>
Now restart the Wazuh manager.
systemctl restart wazuh-manager
Open the file with the text editor
/var/ossec/etc/decoders/local_web-accesslog_decoders.xml
Now modify the decoders so that they can handle your new logs and the other logs as well.
Tips: <prematch> </prematch> can be very useful.
Test your modified decoders with Wazuh logtest tool and once done, restart the manager to apply the changes.
systemctl restart wazuh-manager
Check this document to learn more about modifying default decoders.
Check these documents to learn more about decoder syntax and regex.
Decoders Syntax
Regular Expression Syntax
Let me if you need any further assistance.