Module: check_mk
Branch: master
Commit: d90da4c38b4841a6a6d936893f4f45d35ae3a5df
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d90da4c38b4841…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Mon May 14 11:17:57 2018 +0200
Moved grep filter table to a smaller scope.
Change-Id: Ic9f9d3d4d474fc6ef8fd92b6d6d5ff1535c8abef
---
cmk/ec/main.py | 26 ++++++++++++--------------
1 file changed, 12 insertions(+), 14 deletions(-)
diff --git a/cmk/ec/main.py b/cmk/ec/main.py
index a5f54cf..78f3c28 100644
--- a/cmk/ec/main.py
+++ b/cmk/ec/main.py
@@ -143,20 +143,6 @@ class SyslogFacility(object):
return "(unknown facility %d)" % self.value
-grepping_filters = [
- 'event_text',
- 'event_comment',
- 'event_host',
- 'event_host_regex',
- 'event_contact',
- 'event_application',
- 'event_rule_id',
- 'event_owner',
- 'event_ipaddress',
- 'event_core_host',
-]
-
-
# Alas, we often have no clue about the actual encoding, so we have to guess:
# Initially we assume UTF-8, but fall back to latin-1 if it didn't work.
def decode_from_bytes(string_as_bytes):
@@ -1188,6 +1174,18 @@ def get_event_history_from_file(settings, table_history, query,
logger):
# Optimization: use grep in order to reduce amount
# of read lines based on some frequently used filters.
+ grepping_filters = [
+ 'event_text',
+ 'event_comment',
+ 'event_host',
+ 'event_host_regex',
+ 'event_contact',
+ 'event_application',
+ 'event_rule_id',
+ 'event_owner',
+ 'event_ipaddress',
+ 'event_core_host',
+ ]
greptexts = []
for filter_name, opfunc, args in filters:
# Make sure that the greptexts are in the same order as in the