Seems like realert
function is what you are looking for:
realert
This option allows you to ignore repeating alerts for a period of time. If the rule uses a query_key, this option will be applied on a per key basis. All matches for a given rule, or for matches with the same query_key, will be ignored for the given time. All matches with a missing query_key will be grouped together using a value of _missing. This is applied to the time the alert is sent, not to the time of the event. It defaults to one minute, which means that if alert is run over a large time period which triggers many matches, only the first alert will be sent by default. If you want every alert, set realert to 0 minutes. (Optional, time, default 1 minute)
Example:
filter:
- query_string:
query: "_exists_: hoststate AND datatype: \"HOSTPERFDATA\" AND _exists_: hostname"
query_key: hostname
realert:
minutes: 5
By the way, I encourage you to add ``` ... ```
or ` ... `
signs around configs, codes, function, messages and alerts definition, as it greatly helps us to understand structure and read the configs. Thanks. 🙂