diff --git a/core/lib/rules.py b/core/lib/rules.py index 684d745..b4bfa59 100644 --- a/core/lib/rules.py +++ b/core/lib/rules.py @@ -347,6 +347,7 @@ class NotificationRuleData(object): self.store_match(index, message) self.ingest_matches_sync(index, message, meta, mode) + # No async helper for this one as we only need it for schedules async def rule_no_match(self, index=None): """ A rule has not matched. @@ -362,6 +363,9 @@ class NotificationRuleData(object): if self.object.send_empty: rule_notify(self.object, index, "no_match", None) self.store_match(index, False) + await self.ingest_matches( + index=index, message={}, meta={"msg": "No matches"}, mode="schedule" + ) async def run_schedule(self): """ @@ -468,6 +472,10 @@ class NotificationRuleData(object): raise RuleParseError( "Field tags cannot be used with on-demand rules", "data" ) + if self.cleaned_data["send_empty"]: + raise RuleParseError( + "Field cannot be used with on-demand rules", "send_empty" + ) @property def is_schedule(self):