I'd like to be able to generate some sort of log file on my wazuh windows clients, and put a custom rule and decoder on my server to trigger email alerts. If I can get this to work, I will use it as a general, repeatable approach. I've take a swing at this and so far no joy, am not getting log data in archives.log let alone alerts.log or alerts.json.
One note, on #4 below, my understanding is I need to put my log output into a syslog format, and #4 shows my attempt at this.
Suggestions appreciated:)
I hope the following are the relevant configurations I'm trying:
1) Local File on Windows Client's ossec.conf
<localfile>
<log_format>syslog</log_format>
<location>C:\\Path\\To\\Logs\\log.log</location>
</localfile>
2) Custom Rule
<group name="local,syslog,">
<rule id="100100" level="12">
<decoded_as>syslog</decoded_as>
<match>CustomAlert</match>
<description>Log file contains the words 'CustomAlert'</description>
</rule>
</group>
3) Custom Decoder
decoder name="syslog">
<prematch>^(\w+ \d+ \d+:\d+:\d+) (\S+) </prematch>
</decoder>
4) Log.log
<165>1 2023-09-28T10:12:52.000Z PCName CustomAlert
My assumption is there there is no reason yet to do a wazuh-logtest, as I am not finding any desired entries in archives.log.
Again, help appreciated. Thx