[systemd-bugs] [Bug 89967] New: RFE: journalctl custom output format like --output "%ISODATE [%-5PID] [%FOO] %MESSAGE"
bugzilla-daemon at freedesktop.org
bugzilla-daemon at freedesktop.org
Thu Apr 9 07:20:54 PDT 2015
https://bugs.freedesktop.org/show_bug.cgi?id=89967
Bug ID: 89967
Summary: RFE: journalctl custom output format like --output
"%ISODATE [%-5PID] [%FOO] %MESSAGE"
Product: systemd
Version: unspecified
Hardware: Other
OS: All
Status: NEW
Severity: enhancement
Priority: medium
Component: general
Assignee: systemd-bugs at lists.freedesktop.org
Reporter: cb at lathspell.de
QA Contact: systemd-bugs at lists.freedesktop.org
It would be great if custom formats for journalctl output could be specified.
1. On the command line every paramter that is not a predefined template like
"short-iso" could be parsed like a printf/slf4j/log4j format string.
Example: journalctl --since -1d -u postfix -o "%_ISODATE [-%5_PID]
(%MESSAGEID) %_PROG: %MESSAGE"
2. Both /etc/systemd/journal.conf and ~/.journal.conf could contain pre defined
templates in the above syntax that are available via "--output".
Example:
$ cat ~/.journal.conf
mypostfix="%_ISODATE [-%5_PID] (%MESSAGEID) %_PROG: %MESSAGE"
$ journalctl --since -1d -u postfix -o mypostfix
Both would encourage application developers to add custom fields like for
example the Message-Id for mailer programs or a remote IP for a web server
which only makes sense in for their specific log files.
Of course that could also be archived using pipes but journalctl is already has
some kind of template mechanism so custom ones should be easy.
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-bugs/attachments/20150409/d29e4b8f/attachment.html>
More information about the systemd-bugs
mailing list