From 76752b0085f32cb83ad9d626170c0f1ad8de76c6 Mon Sep 17 00:00:00 2001 From: Bastian Schroll Date: Sun, 24 May 2015 23:22:32 +0200 Subject: [PATCH 1/4] edit config.ini --- config/config.template.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/config.template.ini b/config/config.template.ini index b171c13..5ea121a 100644 --- a/config/config.template.ini +++ b/config/config.template.ini @@ -43,7 +43,7 @@ filter_range_end = 9999999 [Filters] #No Filter for a Typ/Plugin Combination = all Data pass #INDIVIDUAL_NAME = TYP;PLUGIN;REGEX -zvei_local_filter = ZVEI;template;25[0-9F]{3} +##testfilter = ZVEI;template;25[0-9F]{3} #only ZVEI to template with 25### [Plugins] From 623d8967aaba2996c569857750262d1c5f611304 Mon Sep 17 00:00:00 2001 From: Bastian Schroll Date: Sun, 24 May 2015 23:34:09 +0200 Subject: [PATCH 2/4] edit readme --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c53bc91..bad33ae 100644 --- a/README.md +++ b/README.md @@ -16,8 +16,8 @@ unless you are developer you can use the develop-Branch - may be unstable! - FMS, ZVEI and POCSAG512/1200/2400 decoding and Displaying - Plugin support for easy Functions extension - Filtering double alarms with adjustable time -- Filtering Range of POCSAG RIC´s -- Filtering Data for each Typ/Plugin combination +- Filtering Allowed, Denied and Range of POCSAG RIC´s +- Filtering Data for each Typ/Plugin combination with RegEX - All configurations in seperate config File - Data validation (plausibility test) - Logfiles for better Troubleshooting @@ -30,7 +30,7 @@ unless you are developer you can use the develop-Branch - may be unstable! ###Plugins ##### Implemented Plugins: - MySQL (insert Data into MySQL Database [FMS|ZVEI|POC]) -- BosMon (send Data to BosMon Server [ZVEI|POC]) +- BosMon (send Data to BosMon Server [FMS|ZVEI|POC]) - httpRequest (send a request to an URL [FMS|ZVEI|POC]) ##### Plugins for the Future: From d4609476853cbb94105f5f875a22054e37328ab2 Mon Sep 17 00:00:00 2001 From: Bastian Schroll Date: Sun, 24 May 2015 23:52:10 +0200 Subject: [PATCH 3/4] 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: From 3e59ca2127edd557884c2c61ba509ecd4e0d1191 Mon Sep 17 00:00:00 2001 From: Bastian Schroll Date: Sun, 24 May 2015 23:59:00 +0200 Subject: [PATCH 4/4] revert edit in filter.py --- includes/filter.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/filter.py b/includes/filter.py index 670e668..6de5d44 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[typ.lower()]): + if re.search(i["regex"], data): logging.debug("Filter passed: %s", i["name"]) return True else: