From 554f0230864f1489eb494efa2592f8fa32aa4b18 Mon Sep 17 00:00:00 2001
From: Gregory Collins <greg@gregorycollins.net>
Date: Wed, 21 Jan 2015 04:38:58 +0100
Subject: [PATCH] Rewrite journalctl invocations: replace grep/tail pipeline
with journalctl builtins.
---
src/plugins/ccpp_event.conf | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/plugins/ccpp_event.conf b/src/plugins/ccpp_event.conf
index 223144e..15bb18c 100644
--- a/src/plugins/ccpp_event.conf
+++ b/src/plugins/ccpp_event.conf
@@ -40,9 +40,9 @@ EVENT=post-create analyzer=CCpp
else
uid=`cat uid` &&
log="[System Logs]:\n" &&
- log=$log`journalctl -b --since=-3m --system | grep -F -e "$base_executable" | tail -99` &&
+ log=$log`journalctl -b --since=-3m --system -n 99 _COMM="$base_executable"` &&
log=$log"\n[User Logs]:\n" &&
- log=$log`journalctl _UID="$uid" -b --since=-3m | grep -F -e "$base_executable" | tail -99` &&
+ log=$log`journalctl -b --since=-3m -n 99 _COMM="$base_executable" _UID="$uid"` &&
log=`echo -e "$log"`
fi
if test -n "$log"; then
--
2.1.0