summaryrefslogtreecommitdiffstats
path: root/roles/openshift_logging/filter_plugins
diff options
context:
space:
mode:
authorewolinetz <ewolinet@redhat.com>2017-03-03 17:26:44 -0600
committerewolinetz <ewolinet@redhat.com>2017-03-03 17:26:44 -0600
commit7c72a665d9391a1597fe192fa88d6d0a50058185 (patch)
tree9af7706da24c2cfeaa77d1ed47c2fbdebb15e356 /roles/openshift_logging/filter_plugins
parent15601e4b3bbd4aebc4dfd3e6736854af35820150 (diff)
downloadopenshift-7c72a665d9391a1597fe192fa88d6d0a50058185.tar.gz
openshift-7c72a665d9391a1597fe192fa88d6d0a50058185.tar.bz2
openshift-7c72a665d9391a1597fe192fa88d6d0a50058185.tar.xz
openshift-7c72a665d9391a1597fe192fa88d6d0a50058185.zip
Adding some more logging defaults
Diffstat (limited to 'roles/openshift_logging/filter_plugins')
-rw-r--r--roles/openshift_logging/filter_plugins/openshift_logging.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/roles/openshift_logging/filter_plugins/openshift_logging.py b/roles/openshift_logging/filter_plugins/openshift_logging.py
index 007be3ac0..aa1c3738e 100644
--- a/roles/openshift_logging/filter_plugins/openshift_logging.py
+++ b/roles/openshift_logging/filter_plugins/openshift_logging.py
@@ -25,6 +25,10 @@ def entry_from_named_pair(register_pairs, key):
raise RuntimeError("There was no entry found in the dict that had an item with a name that matched {}".format(key))
+def map_from_pairs(source, delim="="):
+ ''' Returns a dict given the source and delim delimited '''
+ return dict(source.split(delim) for item in source.split(","))
+
# pylint: disable=too-few-public-methods
class FilterModule(object):
''' OpenShift Logging Filters '''
@@ -35,4 +39,5 @@ class FilterModule(object):
return {
'random_word': random_word,
'entry_from_named_pair': entry_from_named_pair,
+ 'map_from_pairs': map_from_pairs,
}