From e01aea771277a52449cb9d3459c6ec94701f568b Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Thu, 12 Jan 2023 07:20:48 +0000 Subject: [PATCH] Properly check tokens in notification rules --- core/lib/rules.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/core/lib/rules.py b/core/lib/rules.py index f39a4a0..d1eb5da 100644 --- a/core/lib/rules.py +++ b/core/lib/rules.py @@ -59,6 +59,16 @@ def process_rules(data): value = [value] if field == "src": continue + if field == "tokens": + for token in value: + if "tokens" in message: + if token in message["tokens"]: + matched_field_number += 1 + matched_fields.append(field) + # Break out of the token matching loop + break + # Continue to next field + continue if field in message and message[field] in value: matched_field_number += 1 matched_fields.append(field)