aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames O. D. Hunt <james.o.hunt@intel.com>2017-10-06 15:41:38 +0100
committerBryn M. Reeves <bmr@redhat.com>2018-04-04 17:10:37 +0100
commitcc415800f41685801cea95c680d54f7533c895bb (patch)
tree19e80877f3342186c6327391e6ededaffc4153a9
parent873f76aa7a613a93cbcca8337580e4669654243f (diff)
downloadsos-cc415800f41685801cea95c680d54f7533c895bb.tar.gz
[Plugin] Allow selection of journal entries by identifier
Added an "identifier=" option to Plugin.add_journal() to allow system journal entries to be selected by identifier. Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
-rw-r--r--sos/plugins/__init__.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/sos/plugins/__init__.py b/sos/plugins/__init__.py
index 4d52b150..44502d05 100644
--- a/sos/plugins/__init__.py
+++ b/sos/plugins/__init__.py
@@ -769,7 +769,8 @@ class Plugin(object):
self.custom_text += text
def add_journal(self, units=None, boot=None, since=None, until=None,
- lines=None, allfields=False, output=None, timeout=None):
+ lines=None, allfields=False, output=None, timeout=None,
+ identifier=None):
""" Collect journald logs from one of more units.
Keyword arguments:
@@ -796,6 +797,7 @@ class Plugin(object):
until_opt = " --until %s"
lines_opt = " --lines %s"
output_opt = " --output %s"
+ identifier_opt = " --identifier %s"
if isinstance(units, six.string_types):
units = [units]
@@ -804,6 +806,9 @@ class Plugin(object):
for unit in units:
journal_cmd += unit_opt % unit
+ if identifier:
+ journal_cmd += identifier_opt % identifier
+
if allfields:
journal_cmd += " --all"