journalctl: add --output-fields= (#7181)

This option allows restricting the shown fields in the output modes that
would normally show all fields. It allows clients that are only
interested in a subset of the fields to access those more efficiently.
Also, it makes the resulting size of the output more predictable.

It has no effect on the various `short` output modes, because those
already only show a subset of the fields.
This commit is contained in:
Lars Karlitski
2017-10-27 12:10:47 +09:00
committed by Yu Watanabe
parent a8caf8b251
commit cc25a67e2a
6 changed files with 122 additions and 24 deletions
+14
View File
@@ -384,6 +384,20 @@
</listitem>
</varlistentry>
<varlistentry>
<term><option>--output-fields=</option></term>
<listitem><para>A comma separated list of the fields which should
be included in the output. This only has an effect for the output modes
which would normally show all fields (<option>verbose</option>,
<option>export</option>, <option>json</option>,
<option>json-pretty</option>, and <option>json-sse</option>). The
<literal>__CURSOR</literal>, <literal>__REALTIME_TIMESTAMP</literal>,
<literal>__MONOTONIC_TIMESTAMP</literal>, and
<literal>_BOOT_ID</literal> fields are always
printed.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--utc</option></term>