<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - RFE: journalctl custom output format like --output "%ISODATE [%-5PID] [%FOO] %MESSAGE""
href="https://bugs.freedesktop.org/show_bug.cgi?id=89967">89967</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>RFE: journalctl custom output format like --output "%ISODATE [%-5PID] [%FOO] %MESSAGE"
</td>
</tr>
<tr>
<th>Product</th>
<td>systemd
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Other
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>medium
</td>
</tr>
<tr>
<th>Component</th>
<td>general
</td>
</tr>
<tr>
<th>Assignee</th>
<td>systemd-bugs@lists.freedesktop.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>cb@lathspell.de
</td>
</tr>
<tr>
<th>QA Contact</th>
<td>systemd-bugs@lists.freedesktop.org
</td>
</tr></table>
<p>
<div>
<pre>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.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the QA Contact for the bug.</li>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>