Skip to content

Commit cfad1cc

Browse files
committed
fix issue 2518, where false positive may be triggered sometimes
1 parent 23c9e64 commit cfad1cc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

elastalert/elastalert.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,8 @@ def run_query(self, rule, start=None, end=None, scroll=False):
652652

653653
try:
654654
if rule.get('scroll_id') and self.thread_data.num_hits < self.thread_data.total_hits and should_scrolling_continue(rule):
655-
self.run_query(rule, start, end, scroll=True)
655+
if not self.run_query(rule, start, end, scroll=True):
656+
return False
656657
except RuntimeError:
657658
# It's possible to scroll far enough to hit max recursive depth
658659
pass
@@ -894,7 +895,8 @@ def run_rule(self, rule, endtime, starttime=None):
894895

895896
if rule.get('aggregation_query_element'):
896897
if endtime - tmp_endtime == segment_size:
897-
self.run_query(rule, tmp_endtime, endtime)
898+
if not self.run_query(rule, tmp_endtime, endtime):
899+
return 0
898900
self.thread_data.cumulative_hits += self.thread_data.num_hits
899901
elif total_seconds(rule['original_starttime'] - tmp_endtime) == 0:
900902
rule['starttime'] = rule['original_starttime']

0 commit comments

Comments
 (0)