From d4609476853cbb94105f5f875a22054e37328ab2 Mon Sep 17 00:00:00 2001 From: Bastian Schroll Date: Sun, 24 May 2015 23:52:10 +0200 Subject: [PATCH] little change filter.py --- config/config.template.ini | 6 +++++- includes/filter.py | 8 ++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/config/config.template.ini b/config/config.template.ini index 5ea121a..41667f9 100644 --- a/config/config.template.ini +++ b/config/config.template.ini @@ -41,9 +41,12 @@ filter_range_end = 9999999 [Filters] +#RegEX Filter Configuration #No Filter for a Typ/Plugin Combination = all Data pass #INDIVIDUAL_NAME = TYP;PLUGIN;REGEX -##testfilter = ZVEI;template;25[0-9F]{3} #only ZVEI to template with 25### + +#only ZVEI to template with 25### +#testfilter = ZVEI;template;25[0-9F]{3} [Plugins] @@ -51,6 +54,7 @@ filter_range_end = 9999999 MySQL = 0 BosMon = 0 httpRequest = 0 + # for developing template-module template = 0 diff --git a/includes/filter.py b/includes/filter.py index 6de5d44..670e668 100644 --- a/includes/filter.py +++ b/includes/filter.py @@ -24,16 +24,16 @@ def checkFilters(data,typ,plugin): logging.debug("search Filter for %s to %s", typ, plugin) #extract the correct data for filtering - if typ == "FMS": data = data["fms"] - if typ == "ZVEI": data = data["zvei"] - if typ == "POC": data = data["poc"] + #if typ == "FMS": data = data["fms"] + #if typ == "ZVEI": data = data["zvei"] + #if typ == "POC": data = data["poc"] foundFilter = False for i in globals.filterList: if i["typ"] == typ and i["plugin"] == plugin: foundFilter = True logging.debug("found Filter: %s = %s", i["name"], i["regex"]) - if re.search(i["regex"], data): + if re.search(i["regex"], data[typ.lower()]): logging.debug("Filter passed: %s", i["name"]) return True else: