From 200c5d7fa65c889a697f2c07cc22a87dd11a5a79 Mon Sep 17 00:00:00 2001 From: sivatarunp Date: Wed, 7 Aug 2024 12:39:56 +0530 Subject: [PATCH] fixing error --- elastalert/ruletypes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elastalert/ruletypes.py b/elastalert/ruletypes.py index ddefc58e9..8e6c8aee4 100644 --- a/elastalert/ruletypes.py +++ b/elastalert/ruletypes.py @@ -821,7 +821,7 @@ def check_for_match(self, key, end=True): # Do a deep-copy, otherwise we lose the datetime type in the timestamp field of the last event event = copy.deepcopy(self.occurrences[key].data[-1][0]) event.update(key=key, count=count) - if self.rules['query_key']: + if 'query_key' in self.rules: event[self.rules['query_key']]=key self.add_match(event)