Hello Fabio, how are you?
To achieve what you want, you must create a set of rules rather than decoders.
This is due that decoders for windows TaskScheduler events already exists and is named "event_channel".
A parent rule that catches (but does not log) every TaskScheduler event by it's own event-channel. And then child-rules that filters out every severity level you want to catch.
These child rules must log the filtered events to wazuh dashboard, so level for each of them must be 3 or higher.
Let's figure this out:
In order to filter TaskScheduler events by severity levels "Warning, Error and Critical" you must first create a rule to catch all the TaskScheduler events.
You may create a rule that looks like this one below:
It's adviceable to set level on 0 for this parent Rule, otherwise every TaskScheduler event will be logged onto Wazuh Dashboard
<rule id="606302" level="0">
<if_group>windows</if_group>
<field name="win.system.channel">^Microsoft-Windows-TaskScheduler/Operational$</field>
<options>no_full_log</options>
<description>Group of Windows rules for the Task Scheduler Operational channel</description>
</rule>
Then, you may create child rules in order to catch events by severity.
Remember to set level to 3 to get these filtered events on your wazuh dashboard:
<rule id="77770" level="3">
<if_sid>60601</if_sid>
<field name="win.system.severityValue">^WARNING$</field>
<options>no_full_log</options>
<description>Task Scheduler Warning event</description>
</rule>
<rule id="77771" level="3">
<if_sid>60602</if_sid>
<field name="win.system.severityValue">^ERROR$</field>
<options>no_full_log</options>
<description>Task Scheduler Error event</description>
</rule>You can see more about rules on the Wazuh Documentation:
https://documentation.wazuh.com/current/user-manual/ruleset/ruleset-xml-syntax/rules.htmlAnd especifically about windows logs collection:
https://documentation.wazuh.com/current/user-manual/capabilities/log-data-collection/how-to-collect-wlogs.htmlHope this helps!