journalctl: add with-unit mode

When dealing with a large number of template instances, for example
when launching daemons per VRF, it is hard for operators to correlate
log lines to arguments.
Add a new with-unit mode which, if available, prefixes unit and user
unit names when displaying its log messages instead of the syslog
identifier. It will also use the full timestamp with timezones, like
the short-full mode.
This commit is contained in:
Luca Boccassi
2018-05-25 14:45:34 +02:00
committed by Zbigniew Jędrzejewski-Szmek
parent c1a1b409ce
commit 49805b3d81
7 changed files with 38 additions and 9 deletions
+1 -1
View File
@@ -66,7 +66,7 @@ _journalctl() {
compopt -o filenames
;;
--output|-o)
comps='short short-full short-iso short-iso-precise short-precise short-monotonic short-unix verbose export json json-pretty json-sse cat'
comps='short short-full short-iso short-iso-precise short-precise short-monotonic short-unix verbose export json json-pretty json-sse cat with-unit'
;;
--field|-F)
comps=$(journalctl --fields | sort 2>/dev/null)