Allow partial matching on msg field

This commit is contained in:
Mark Veidemanis 2023-01-12 07:20:48 +00:00
parent 4f55ffeaf7
commit 031995d4b9
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
1 changed files with 12 additions and 0 deletions

View File

@ -76,6 +76,18 @@ def process_rules(data):
break
# Continue to next field
continue
# Allow partial matches for msg
if field == "msg":
for msg in value:
if "msg" in message:
if msg in message["msg"]:
matched_field_number += 1
matched_fields.append(field)
# Break out of the msg 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)