Hi, thanks for replying.
While testing i discovered that the log i was testing was not the one that the manager was recieving.
This is a log line from the 'archives.log' file (note that i did insert manually, in the agent configuration file, the log file that has to be monitored):
--START OF LOG LINE--
2024 May 22 09:02:12 (hostname) any->/var/log/clamd.scan Wed May 22 11:02:12 2024 -> /home/user/testclam: Eicar-Signature FOUND
--END OF LOG LINE--
I don't remember where (probably in some thread on reddit or here on the mailing list), but i read that the header is added by the wazuh system and is not actually the log that it's going to be "parsed".
This is the entire decoder i'm using, stored in /var/ossec/etc/decoders/local_decoder.xml:
--START OF DECODER--
<decoder name="clamd">
<program_name>^clamd</program_name>
</decoder>
<decoder name="clamd-found">
<parent>clamd</parent>
<prematch>^FOUND</prematch>
<regex>(\S+)(\s)(\w+)\s+(\w+)\s+(\d+:\d+:\d+)\s+(\d{4})\s+->\s+(.+?):\s+(.*)$</regex>
<order>timestamp, file_path, extra_data</order>
</decoder>
<decoder name="freshclam">
<program_name>^freshclam</program_name>
</decoder>
--END OF DECODER--
I disabled the original decoder as suggested by the wazuh documentation.
The regex has been tested in regex101 with the log line i gave you (with no header), and it should work as intended.
Right now the ruleset test tool gives me the "no decoder found" "error".
Let me know if you need anything else.
Regards,
Gabriele