As per the requirement we have prepared below mentioned filter and it is working fine for us. Please give another try and let us know how it goes for you.
type: EventFilter
api_version: core/v2
metadata:
name: fatigue-resolve-alert-filter
namespace: default
labels:
Sensu | Page not found sensuctl
created_by: sensu
spec:
action: allow
expressions:
(
(event.check.status != 0 && event.check.occurrences == event.check.annotations[“fatigue_check/occurrences”]) ||
(event.check.status == 0 &&
event.check.history[-1].status != 0 &&
event.check.history[-2].status != 0 &&
event.check.history[-3].status != 0 &&
event.check.occurrences >= event.check.annotations[“fatigue_check/occurrences”])
)
Many Thanks,
Nasirhussen