Module: check_mk
Branch: master
Commit: b8d22fcbfc1708378df582a2cff45e005a7ced60
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b8d22fcbfc1708…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Fri Apr 13 13:27:41 2018 +0200
5990 Event Console search takes "Text to match" into account
Change-Id: I6f5a321b44a0b77ed99425bab00663f13738bfbe
---
.werks/5990 | 10 ++++++++++
web/plugins/wato/mkeventd.py | 5 +++--
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/.werks/5990 b/.werks/5990
new file mode 100644
index 0000000..b9e702e
--- /dev/null
+++ b/.werks/5990
@@ -0,0 +1,10 @@
+Title: Event Console search takes "Text to match" into account
+Level: 1
+Component: multisite
+Compatible: compat
+Edition: cre
+Version: 1.6.0i1
+Date: 1523618719
+Class: feature
+
+
diff --git a/web/plugins/wato/mkeventd.py b/web/plugins/wato/mkeventd.py
index a9c7b65..929d43a 100644
--- a/web/plugins/wato/mkeventd.py
+++ b/web/plugins/wato/mkeventd.py
@@ -1356,7 +1356,7 @@ def filter_mkeventd_rule_packs(search_expression, rule_packs):
found_packs.setdefault(rule_pack["id"], [])
for rule in rule_pack.get("rules", []):
if search_expression in rule["id"].lower() \
- or search_expression in rule.get("description").lower():
+ or search_expression in rule.get("description",
"").lower():
found_rules = found_packs.setdefault(rule_pack["id"], [])
found_rules.append(rule)
return found_packs
@@ -1618,7 +1618,8 @@ def filter_mkeventd_rules(search_expression, rule_pack):
found_rules = []
for rule in rule_pack.get("rules", []):
if search_expression in rule["id"].lower() \
- or search_expression in rule.get("description").lower():
+ or search_expression in rule.get("description",
"").lower() \
+ or search_expression in rule.get("match", "").lower():
found_rules.append(rule)
return found_rules