Hi Niall,
Both, the decoding and alerting phases are complementary. The decoding phase relies on the alerting phase, and the alerting phase relies on the decoding phase.
Once an event is received by the manager, the decoder starts parsing this information (decoding phase, which does not generate any additional logs while being performed). Once this event is parsed, this event is not injected to Splunk, so there is not any log ingestion in this phase. When this decoding phase is finished, the already parsed event go through the rules (which we can call the alerting phase). If this event does not match any rule, no alert would be generated, so it will not be injected to Splunk either. Only when an event matches a rule the alerting phase take place and this event is actually being sent to Splunk.
In a nutshell, there is not any log ingestion to Splunk after the decoding phase, only after the alerting one and just in the case an event matches a rule, so an alert is generated. This alert is what is being sent to Splunk.
We could also say that the decoder is the first phase and if an event matches a decoder, it would pass to the second phase, which is the alerting one. Once in this second phase, if this already parsed event matches a rule, an alert will be generated and only then we will pass to the third phase, which is the ingestion of this alert to Splunk.
Lastly, you can check the Splunk Forwarder configuration in this file /opt/splunkforwarder/etc/system/local/inputs.conf, which contains this information by default:
[monitor:///var/ossec/logs/alerts/alerts.json]
disabled = 0
host = MANAGER_HOSTNAME
index = wazuh
sourcetype = wazuh
This is where you can make sure that the information is being picked from only the alerts.json file, where all the events are being stored after matching a certain rule and also matching a decoder. They are only stored there if they surpassed both, the decoding and alerting phase. If an event only passes one of them, it will not be injected to Splunk nor stored here.
Let me know if you have any questions.
Regards,
Yana.