Understanding the Custom Event Handler Configuration:
The event handler is set up to generate events based on specific log data.
The goal is to generate events specifically for spam emails detected by FortiMail.
Analyzing the Issue:
The event handler is currently generating events for both spam emails and clean emails.
This indicates that the rule ' s filtering criteria are not correctly distinguishing between spam and non-spam emails.
Evaluating the Options:
Option A: Selecting the " Anti-Spam Log (spam) " in the Log Type field will ensure that only logs related to spam emails are considered. This is the most straightforward and accurate way to filter for spam emails.
Option B: Typing type==spam in the Log filter by Text field might help filter the logs, but it is not as direct and reliable as selecting the correct log type.
Option C: Disabling the rule to use the filter in the data selector to create the event does not address the issue of filtering for spam logs specifically.
Option D: Selecting " Within a group, the log field Spam Name (snane) has 2 or more unique values " is not directly relevant to filtering spam logs and could lead to incorrect filtering criteria.
Conclusion:
The correct change to make in the rule is to select " Anti-Spam Log (spam) " in the Log Type field. This ensures that the event handler only generates events for spam emails.
[References:, Fortinet Documentation on Event Handlers and Log Types., Best Practices for Configuring FortiMail Anti-Spam Settings., , , ]