Clean up debug statements
This commit is contained in:
parent
37789a1f18
commit
b68d7606f8
|
@ -37,10 +37,8 @@ def process_rules(data):
|
||||||
for rule in all_rules:
|
for rule in all_rules:
|
||||||
parsed_rule = rule.parse()
|
parsed_rule = rule.parse()
|
||||||
if "index" not in parsed_rule:
|
if "index" not in parsed_rule:
|
||||||
log.debug("No index specified in rule, skipping")
|
|
||||||
continue
|
continue
|
||||||
if "source" not in parsed_rule:
|
if "source" not in parsed_rule:
|
||||||
log.debug("No source specified in rule, skipping")
|
|
||||||
continue
|
continue
|
||||||
rule_index = parsed_rule["index"]
|
rule_index = parsed_rule["index"]
|
||||||
rule_source = parsed_rule["source"]
|
rule_source = parsed_rule["source"]
|
||||||
|
@ -49,10 +47,8 @@ def process_rules(data):
|
||||||
if not type(rule_source) == list:
|
if not type(rule_source) == list:
|
||||||
rule_source = [rule_source]
|
rule_source = [rule_source]
|
||||||
if index not in rule_index:
|
if index not in rule_index:
|
||||||
log.debug(f"{index} not in {rule_index}")
|
|
||||||
continue
|
continue
|
||||||
if message["src"] not in rule_source:
|
if message["src"] not in rule_source:
|
||||||
log.debug(f"{message['src']} not in {rule_source}")
|
|
||||||
continue
|
continue
|
||||||
|
|
||||||
rule_field_length = len(parsed_rule.keys())
|
rule_field_length = len(parsed_rule.keys())
|
||||||
|
@ -66,7 +62,6 @@ def process_rules(data):
|
||||||
if field in message and message[field] in value:
|
if field in message and message[field] in value:
|
||||||
matched_field_number += 1
|
matched_field_number += 1
|
||||||
matched_fields.append(field)
|
matched_fields.append(field)
|
||||||
print("Matched field", field, message[field], value)
|
|
||||||
if matched_field_number == rule_field_length - 2:
|
if matched_field_number == rule_field_length - 2:
|
||||||
rule_matched(rule, message, matched_fields)
|
rule_matched(rule, message, matched_fields)
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import msgpack
|
import msgpack
|
||||||
from django.core.management.base import BaseCommand, CommandError
|
from django.core.management.base import BaseCommand
|
||||||
from redis import StrictRedis
|
from redis import StrictRedis
|
||||||
|
|
||||||
from core.lib.rules import process_rules
|
from core.lib.rules import process_rules
|
||||||
|
|
Loading…
Reference in New Issue