Add total hits to output

This commit is contained in:
2023-02-01 07:20:24 +00:00
parent 53cb9a7f76
commit 66596cda42
4 changed files with 18 additions and 6 deletions

View File

@@ -78,7 +78,8 @@ def process_rules(data):
matched[field] = message[field]
# Subtract 2, 1 for source and 1 for index
if matched_field_number == rule_field_length - 2:
rule_notify(rule, index, message, matched)
meta = {"matched": matched, "total_hits": 1}
rule_notify(rule, index, message, meta=meta)
class Command(BaseCommand):