From 3190b48a4502e18ab20b657b38288ac01075a7b4 Mon Sep 17 00:00:00 2001 From: Bradley Kemp Date: Thu, 5 Sep 2024 12:26:46 +0100 Subject: [PATCH] fix usage of rule.comparators --- evaluator/evaluate.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/evaluator/evaluate.go b/evaluator/evaluate.go index 2484ed1..7cf033b 100644 --- a/evaluator/evaluate.go +++ b/evaluator/evaluate.go @@ -111,7 +111,7 @@ func (rule RuleEvaluator) matches(ctx context.Context, event Event, comparators // must evaluate all searches up front for identifier, search := range rule.Detection.Searches { var err error - result.SearchResults[identifier], err = rule.evaluateSearch(ctx, search, event, rule.comparators) + result.SearchResults[identifier], err = rule.evaluateSearch(ctx, search, event, comparators) if err != nil { return Result{}, fmt.Errorf("error evaluating search %s: %w", identifier, err) } @@ -130,7 +130,7 @@ func (rule RuleEvaluator) matches(ctx context.Context, event Event, comparators return false // compatibility with old behaviour } var err error - result.SearchResults[identifier], err = rule.evaluateSearch(ctx, search, event, rule.comparators) + result.SearchResults[identifier], err = rule.evaluateSearch(ctx, search, event, comparators) if err != nil { searchErr = fmt.Errorf("error evaluating search %s: %w", identifier, err) return false