Debian Codegraph @

man/journalctl.xml

raw
1 <?xml version='1.0'?> <!--*-nxml-*-->
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
4 <!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
5
6 <refentry id="journalctl"
7 xmlns:xi="http://www.w3.org/2001/XInclude">
8
9 <refentryinfo>
10 <title>journalctl</title>
11 <productname>systemd</productname>
12 </refentryinfo>
13
14 <refmeta>
15 <refentrytitle>journalctl</refentrytitle>
16 <manvolnum>1</manvolnum>
17 </refmeta>
18
19 <refnamediv>
20 <refname>journalctl</refname>
21 <refpurpose>Print log entries from the systemd journal</refpurpose>
22 </refnamediv>
23
24 <refsynopsisdiv>
25 <cmdsynopsis>
26 <command>journalctl</command>
27 <arg choice="opt" rep="repeat">OPTIONS</arg>
28 <arg choice="opt" rep="repeat">MATCHES</arg>
29 </cmdsynopsis>
30 </refsynopsisdiv>
31
32 <refsect1>
33 <title>Description</title>
34
35 <para><command>journalctl</command> is used to print the log entries stored in the journal by
36 <citerefentry><refentrytitle>systemd-journald.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
37 and
38 <citerefentry><refentrytitle>systemd-journal-remote.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
39 </para>
40
41 <para>If called without parameters, it will show the contents of the journal accessible to the calling
42 user, starting with the oldest entry collected.</para>
43
44 <para>If one or more match arguments are passed, the output is filtered accordingly. A match is in the
45 format <literal>FIELD=VALUE</literal>, e.g. <literal>_SYSTEMD_UNIT=httpd.service</literal>, referring to
46 the components of a structured journal entry. See
47 <citerefentry><refentrytitle>systemd.journal-fields</refentrytitle><manvolnum>7</manvolnum></citerefentry>
48 for a list of well-known fields. If multiple matches are specified matching different fields, the log
49 entries are filtered by both, i.e. the resulting output will show only entries matching all the specified
50 matches of this kind. If two matches apply to the same field, then they are automatically matched as
51 alternatives, i.e. the resulting output will show entries matching any of the specified matches for the
52 same field. Finally, the character <literal>+</literal> may appear as a separate word between other terms
53 on the command line. This causes all matches before and after to be combined in a disjunction
54 (i.e. logical OR).</para>
55
56 <para>It is also possible to filter the entries by specifying an absolute file path as an argument. The
57 file path may be a file or a symbolic link and the file must exist at the time of the query. If a file
58 path refers to an executable binary, an <literal>_EXE=</literal> match for the canonicalized binary path
59 is added to the query. If a file path refers to an executable script, a <literal>_COMM=</literal> match
60 for the script name is added to the query. If a file path refers to a device node,
61 <literal>_KERNEL_DEVICE=</literal> matches for the kernel name of the device and for each of its ancestor
62 devices is added to the query. Symbolic links are dereferenced, kernel names are synthesized, and parent
63 devices are identified from the environment at the time of the query. In general, a device node is the
64 best proxy for an actual device, as log entries do not usually contain fields that identify an actual
65 device. For the resulting log entries to be correct for the actual device, the relevant parts of the
66 environment at the time the entry was logged, in particular the actual device corresponding to the device
67 node, must have been the same as those at the time of the query. Because device nodes generally change
68 their corresponding devices across reboots, specifying a device node path causes the resulting entries to
69 be restricted to those from the current boot.</para>
70
71 <para>Additional constraints may be added using options <option>--boot</option>,
72 <option>--unit=</option>, etc., to further limit what entries will be shown (logical AND).</para>
73
74 <para>Output is interleaved from all accessible journal files, whether they are rotated or currently
75 being written, and regardless of whether they belong to the system itself or are accessible user
76 journals. The <option>--header</option> option can be used to identify which files
77 <emphasis>are</emphasis> being shown.</para>
78
79 <para>The set of journal files which will be used can be modified using the <option>--user</option>,
80 <option>--system</option>, <option>--directory=</option>, and <option>--file=</option> options, see
81 below.</para>
82
83 <para>All users are granted access to their private per-user journals. However, by default, only root and
84 users who are members of a few special groups are granted access to the system journal and the journals
85 of other users. Members of the groups <literal>systemd-journal</literal>, <literal>adm</literal>, and
86 <literal>wheel</literal> can read all journal files. Note that the two latter groups traditionally have
87 additional privileges specified by the distribution. Members of the <literal>wheel</literal> group can
88 often perform administrative tasks.</para>
89
90 <para>The output is paged through <command>less</command> by default, and long lines are "truncated" to
91 screen width. The hidden part can be viewed by using the left-arrow and right-arrow keys. Paging can be
92 disabled; see the <option>--no-pager</option> option and the "Environment" section below.</para>
93
94 <para>When outputting to a tty, lines are colored according to priority: lines of level ERROR and higher
95 are colored red; lines of level WARNING are colored yellow; lines of level NOTICE are highlighted;
96 lines of level INFO are displayed normally; lines of level DEBUG are colored grey.</para>
97
98 <para>To write entries <emphasis>to</emphasis> the journal, a few methods may be used. In general, output
99 from systemd units is automatically connected to the journal, see
100 <citerefentry><refentrytitle>systemd-journald.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
101 In addition,
102 <citerefentry><refentrytitle>systemd-cat</refentrytitle><manvolnum>1</manvolnum></citerefentry>
103 may be used to send messages to the journal directly.</para>
104 </refsect1>
105
106 <refsect1>
107 <title>Source Options</title>
108
109 <para>The following options control where to read journal records from:</para>
110
111 <variablelist>
112 <varlistentry>
113 <term><option>--system</option></term>
114 <term><option>--user</option></term>
115
116 <listitem><para>Show messages from system services and the kernel (with
117 <option>--system</option>). Show messages from service of current user (with
118 <option>--user</option>). If neither is specified, show all messages that the user can see.
119 </para>
120
121 <para>The <option>--user</option> option affects how <option>--unit=</option> arguments are
122 treated. See <option>--unit=</option>.</para>
123
124 <para>Note that <option>--user</option> only works if persistent logging is enabled, via the
125 <varname>Storage=</varname> setting in
126 <citerefentry><refentrytitle>journald.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
127
128 <xi:include href="version-info.xml" xpointer="v205"/></listitem>
129 </varlistentry>
130
131 <varlistentry>
132 <term><option>-M</option></term>
133 <term><option>--machine=</option></term>
134
135 <listitem><para>Show messages from a running, local container. Specify a container name to connect
136 to.</para>
137
138 <xi:include href="version-info.xml" xpointer="v209"/></listitem>
139 </varlistentry>
140
141 <varlistentry>
142 <term><option>-m</option></term>
143 <term><option>--merge</option></term>
144
145 <listitem><para>Show entries interleaved from all available journals, including remote
146 ones.</para>
147
148 <xi:include href="version-info.xml" xpointer="v190"/></listitem>
149 </varlistentry>
150
151 <varlistentry>
152 <term><option>-D <replaceable>DIR</replaceable></option></term>
153 <term><option>--directory=<replaceable>DIR</replaceable></option></term>
154
155 <listitem><para>Takes a directory path as argument. If specified, journalctl will operate on the
156 specified journal directory <replaceable>DIR</replaceable> instead of the default runtime and system
157 journal paths.</para>
158
159 <xi:include href="version-info.xml" xpointer="v187"/></listitem>
160 </varlistentry>
161
162 <varlistentry>
163 <term><option>-i <replaceable>GLOB</replaceable></option></term>
164 <term><option>--file=<replaceable>GLOB</replaceable></option></term>
165
166 <listitem><para>Takes a file glob as an argument. If specified, journalctl will operate on the
167 specified journal files matching <replaceable>GLOB</replaceable> instead of the default runtime and
168 system journal paths. May be specified multiple times, in which case files will be suitably
169 interleaved.</para>
170
171 <xi:include href="version-info.xml" xpointer="v205"/></listitem>
172 </varlistentry>
173
174 <varlistentry>
175 <term><option>--root=<replaceable>ROOT</replaceable></option></term>
176
177 <listitem><para>Takes a directory path as an argument. If specified, <command>journalctl</command>
178 will operate on journal directories and catalog file hierarchy underneath the specified directory
179 instead of the root directory (e.g. <option>--update-catalog</option> will create
180 <filename><replaceable>ROOT</replaceable>/var/lib/systemd/catalog/database</filename>, and journal
181 files under <filename><replaceable>ROOT</replaceable>/run/journal/</filename> or
182 <filename><replaceable>ROOT</replaceable>/var/log/journal/</filename> will be displayed).
183 </para>
184
185 <xi:include href="version-info.xml" xpointer="v201"/></listitem>
186 </varlistentry>
187
188 <varlistentry>
189 <term><option>--image=<replaceable>IMAGE</replaceable></option></term>
190
191 <listitem><para>Takes a path to a disk image file or block device node. If specified,
192 <command>journalctl</command> will operate on the file system in the indicated disk image. This
193 option is similar to <option>--root=</option>, but operates on file systems stored in disk images or
194 block devices, thus providing an easy way to extract log data from disk images. The disk image should
195 either contain just a file system or a set of file systems within a GPT partition table, following
196 the <ulink url="https://uapi-group.org/specifications/specs/discoverable_partitions_specification">UAPI.2 Discoverable Partitions
197 Specification</ulink>. For further information on supported disk images, see
198 <citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry>'s
199 switch of the same name.</para>
200
201 <xi:include href="version-info.xml" xpointer="v247"/></listitem>
202 </varlistentry>
203
204 <xi:include href="standard-options.xml" xpointer="image-policy-open" />
205
206 <varlistentry>
207 <term><option>--namespace=<replaceable>NAMESPACE</replaceable></option></term>
208
209 <listitem><para>Takes a journal namespace identifier string as argument. If not specified, the data
210 collected by the default namespace is shown. If specified, shows the log data of the specified
211 namespace instead. If the namespace is specified as <literal>*</literal> data from all namespaces is
212 shown, interleaved. If the namespace identifier is prefixed with <literal>+</literal> data from the
213 specified namespace and the default namespace is shown, interleaved, but no other. For details about
214 journal namespaces see
215 <citerefentry><refentrytitle>systemd-journald.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
216
217 <xi:include href="version-info.xml" xpointer="v245"/></listitem>
218 </varlistentry>
219 </variablelist>
220 </refsect1>
221
222 <refsect1>
223 <title>Filtering Options</title>
224
225 <para>The following options control how to filter journal records:</para>
226
227 <variablelist>
228 <varlistentry>
229 <term><option>-S</option></term>
230 <term><option>--since=</option></term>
231 <term><option>-U</option></term>
232 <term><option>--until=</option></term>
233
234 <listitem><para>Start showing entries on or newer than the specified date, or on or older than the
235 specified date, respectively. Date specifications should be of the format <literal>2012-10-30
236 18:17:16</literal>. If the time part is omitted, <literal>00:00:00</literal> is assumed. If only
237 the seconds component is omitted, <literal>:00</literal> is assumed. If the date component is
238 omitted, the current day is assumed. Alternatively the strings <literal>yesterday</literal>,
239 <literal>today</literal>, <literal>tomorrow</literal> are understood, which refer to 00:00:00 of the
240 day before the current day, the current day, or the day after the current day,
241 respectively. <literal>now</literal> refers to the current time. Finally, relative times may be
242 specified, prefixed with <literal>-</literal> or <literal>+</literal>, referring to times before or
243 after the current time, respectively. For complete time and date specification, see
244 <citerefentry><refentrytitle>systemd.time</refentrytitle><manvolnum>7</manvolnum></citerefentry>. Note
245 that <option>--output=short-full</option> prints timestamps that follow precisely this format.
246 </para>
247
248 <xi:include href="version-info.xml" xpointer="v195"/></listitem>
249 </varlistentry>
250
251 <varlistentry>
252 <term><option>-c</option></term>
253 <term><option>--cursor=</option></term>
254
255 <listitem><para>Start showing entries from the location in the journal specified by the passed
256 cursor.</para>
257
258 <xi:include href="version-info.xml" xpointer="v193"/></listitem>
259 </varlistentry>
260
261 <varlistentry>
262 <term><option>--after-cursor=</option></term>
263
264 <listitem><para>Start showing entries from the location in the journal <emphasis>after</emphasis>
265 the location specified by the passed cursor. The cursor is shown when the
266 <option>--show-cursor</option> option is used.</para>
267
268 <xi:include href="version-info.xml" xpointer="v206"/></listitem>
269 </varlistentry>
270
271 <varlistentry>
272 <term><option>--cursor-file=<replaceable>FILE</replaceable></option></term>
273
274 <listitem><para>If <replaceable>FILE</replaceable> exists and contains a cursor, start showing
275 entries <emphasis>after</emphasis> this location. Otherwise, show entries according to the other
276 given options. At the end, write the cursor of the last entry to
277 <replaceable>FILE</replaceable>. Use this option to continually read the journal by sequentially
278 calling <command>journalctl</command>.</para>
279
280 <xi:include href="version-info.xml" xpointer="v242"/></listitem>
281 </varlistentry>
282
283 <varlistentry>
284 <term><option>-b <optional><optional><replaceable>ID</replaceable></optional><optional><replaceable>±offset</replaceable></optional>|<constant>all</constant></optional></option></term>
285 <term><option>--boot<optional>=<optional><replaceable>ID</replaceable></optional><optional><replaceable>±offset</replaceable></optional>|<constant>all</constant></optional></option></term>
286
287 <listitem><para>Show messages from a specific boot. This will add a match for
288 <literal>_BOOT_ID=</literal>.</para>
289
290 <para>The argument may be empty, in which case logs for the current boot will be shown.</para>
291
292 <para>If the boot ID is omitted, a positive <replaceable>offset</replaceable> will look up the boots
293 starting from the beginning of the journal, and an equal-or-less-than zero
294 <replaceable>offset</replaceable> will look up boots starting from the end of the journal. Thus,
295 <constant>1</constant> means the first boot found in the journal in chronological order,
296 <constant>2</constant> the second and so on; while <constant>-0</constant> is the last boot,
297 <constant>-1</constant> the boot before last, and so on. An empty <replaceable>offset</replaceable>
298 is equivalent to specifying <constant>-0</constant>, except when the current boot is not the last
299 boot (e.g. because <option>--directory=</option> was specified to look at logs from a different
300 machine).</para>
301
302 <para>If the 32-character <replaceable>ID</replaceable> is specified, it may optionally be followed
303 by <replaceable>offset</replaceable> which identifies the boot relative to the one given by boot
304 <replaceable>ID</replaceable>. Negative values mean earlier boots and positive values mean later
305 boots. If <replaceable>offset</replaceable> is not specified, a value of zero is assumed, and the
306 logs for the boot given by <replaceable>ID</replaceable> are shown.</para>
307
308 <para>The special argument <constant>all</constant> can be used to negate the effect of an earlier
309 use of <option>-b</option>.</para>
310
311 <xi:include href="version-info.xml" xpointer="v186"/></listitem>
312 </varlistentry>
313
314 <varlistentry>
315 <term><option>-u</option></term>
316 <term><option>--unit=<replaceable>UNIT</replaceable>|<replaceable>PATTERN</replaceable></option></term>
317
318 <listitem><para>Show messages for the specified systemd unit <replaceable>UNIT</replaceable> (such as
319 a service unit), or for any of the units matched by <replaceable>PATTERN</replaceable>. If a pattern
320 is specified, a list of unit names found in the journal is compared with the specified pattern and
321 all that match are used. For each unit name, a match is added for messages from the unit
322 (<literal>_SYSTEMD_UNIT=<replaceable>UNIT</replaceable></literal>), along with additional matches for
323 messages from systemd and messages about coredumps for the specified unit. A match is also added for
324 <literal>_SYSTEMD_SLICE=<replaceable>UNIT</replaceable></literal>, such that if the provided
325 <replaceable>UNIT</replaceable> is a
326 <citerefentry><refentrytitle>systemd.slice</refentrytitle><manvolnum>5</manvolnum></citerefentry>
327 unit, all logs of children of the slice will be shown.</para>
328
329 <para>With <option>--user</option>, all <option>--unit=</option> arguments will be converted to match
330 user messages as if specified with <option>--user-unit=</option>.</para>
331
332 <para>This parameter can be specified multiple times.</para>
333
334 <xi:include href="version-info.xml" xpointer="v195"/></listitem>
335 </varlistentry>
336
337 <varlistentry>
338 <term><option>--user-unit=</option></term>
339
340 <listitem><para>Show messages for the specified user session unit. This will add a match for messages
341 from the unit (<literal>_SYSTEMD_USER_UNIT=</literal> and <literal>_UID=</literal>) and additional
342 matches for messages from session systemd and messages about coredumps for the specified unit. A
343 match is also added for <literal>_SYSTEMD_USER_SLICE=<replaceable>UNIT</replaceable></literal>, such
344 that if the provided <replaceable>UNIT</replaceable> is a
345 <citerefentry><refentrytitle>systemd.slice</refentrytitle><manvolnum>5</manvolnum></citerefentry>
346 unit, all logs of children of the unit will be shown.</para>
347
348 <para>This parameter can be specified multiple times.</para>
349
350 <xi:include href="version-info.xml" xpointer="v198"/></listitem>
351 </varlistentry>
352
353 <varlistentry>
354 <term><option>-I</option></term>
355 <term><option>--invocation=<replaceable>ID</replaceable><optional><replaceable>±offset</replaceable></optional>|<replaceable>offset</replaceable></option></term>
356
357 <listitem>
358 <para>Show messages from a specific invocation of unit. This will add a match for
359 <literal>_SYSTEMD_INVOCATION_ID=</literal>, <literal>OBJECT_SYSTEMD_INVOCATION_ID=</literal>,
360 <literal>INVOCATION_ID=</literal>, <literal>USER_INVOCATION_ID=</literal>.</para>
361
362 <para>A positive <replaceable>offset</replaceable> will look up the invocations of a systemd unit
363 from the beginning of the journal, and zero or a negative offset will look up invocations starting
364 from the end of the journal. Thus, <constant>1</constant> means the first invocation found in the
365 journal in chronological order, <constant>2</constant> the second and so on; while
366 <constant>0</constant> is the latest invocation, <constant>-1</constant> the invocation before the
367 latest, and so on.</para>
368
369 <para>If the 32-character <replaceable>ID</replaceable> is specified, it may optionally be followed
370 by <replaceable>±offset</replaceable> which identifies the invocation relative to the one given by
371 invocation <replaceable>ID</replaceable>. Negative values mean earlier invocations and positive
372 values mean later invocations. If <replaceable>±offset</replaceable> is not specified, a value of
373 zero is assumed, and the logs for the invocation given by <replaceable>ID</replaceable> will be
374 shown.</para>
375
376 <para><option>-I</option> is equivalent to <option>--invocation=0</option>, and logs for the latest
377 invocation will be shown.</para>
378
379 <para>When an offset is specified, a unit name must be specified with <option>-u/--unit=</option>
380 or <option>--user-unit=</option> option.</para>
381
382 <para>When specified with <option>-b/--boot=</option>, then invocations are searched within the
383 specified boot.</para>
384
385 <xi:include href="version-info.xml" xpointer="v257"/>
386 </listitem>
387 </varlistentry>
388
389 <varlistentry>
390 <term><option>-t</option></term>
391 <term><option>--identifier=<replaceable>SYSLOG_IDENTIFIER</replaceable></option></term>
392
393 <listitem><para>Show messages for the specified syslog identifier
394 <replaceable>SYSLOG_IDENTIFIER</replaceable>.</para>
395
396 <para>This parameter can be specified multiple times.</para>
397
398 <xi:include href="version-info.xml" xpointer="v217"/></listitem>
399 </varlistentry>
400
401 <varlistentry>
402 <term><option>-T</option></term>
403 <term><option>--exclude-identifier=<replaceable>SYSLOG_IDENTIFIER</replaceable></option></term>
404
405 <listitem><para>Exclude messages for the specified syslog identifier
406 <replaceable>SYSLOG_IDENTIFIER</replaceable>.</para>
407
408 <para>This parameter can be specified multiple times.</para>
409
410 <xi:include href="version-info.xml" xpointer="v256"/></listitem>
411 </varlistentry>
412
413 <varlistentry>
414 <term><option>-p</option></term>
415 <term><option>--priority=</option></term>
416
417 <listitem><para>Filter output by message priorities or priority ranges. Takes either a single numeric
418 or textual log level (i.e. between 0/<literal>emerg</literal> and 7/<literal>debug</literal>), or a
419 range of numeric/text log levels in the form FROM..TO. The log levels are the usual syslog log levels
420 as documented in <citerefentry
421 project='man-pages'><refentrytitle>syslog</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
422 i.e. <literal>emerg</literal> (0), <literal>alert</literal> (1), <literal>crit</literal> (2),
423 <literal>err</literal> (3), <literal>warning</literal> (4), <literal>notice</literal> (5),
424 <literal>info</literal> (6), <literal>debug</literal> (7). If a single log level is specified, all
425 messages with this log level or a lower (hence more important) log level are shown. If a range is
426 specified, all messages within the range are shown, including both the start and the end value of the
427 range. This will add <literal>PRIORITY=</literal> matches for the specified
428 priorities.</para>
429
430 <xi:include href="version-info.xml" xpointer="v188"/></listitem>
431 </varlistentry>
432
433 <varlistentry>
434 <term><option>--facility=</option></term>
435
436 <listitem><para>Filter output by syslog facility. Takes a comma-separated list of numbers or
437 facility names. The names are the usual syslog facilities as documented in <citerefentry
438 project='man-pages'><refentrytitle>syslog</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
439 <option>--facility=help</option> may be used to display a list of known facility names and exit.
440 </para>
441
442 <xi:include href="version-info.xml" xpointer="v245"/></listitem>
443 </varlistentry>
444
445 <varlistentry>
446 <term><option>-g</option></term>
447 <term><option>--grep=</option></term>
448
449 <listitem><para>Filter output to entries where the <varname>MESSAGE=</varname> field matches the
450 specified regular expression. PERL-compatible regular expressions are used, see <citerefentry
451 project='url'><refentrytitle
452 url='http://pcre.org/current/doc/html/pcre2pattern.html'>pcre2pattern</refentrytitle><manvolnum>3</manvolnum></citerefentry>
453 for a detailed description of the syntax.</para>
454
455 <para>If the pattern is all lowercase, matching is case insensitive. Otherwise, matching is case
456 sensitive. This can be overridden with the <option>--case-sensitive</option> option, see
457 below.</para>
458
459 <para>When used with <option>--lines=</option> (not prefixed with <literal>+</literal>),
460 <option>--reverse</option> is implied.</para>
461
462 <xi:include href="version-info.xml" xpointer="v237"/></listitem>
463 </varlistentry>
464
465 <varlistentry>
466 <term><option>--case-sensitive<optional>=BOOLEAN</optional></option></term>
467
468 <listitem><para>Make pattern matching case sensitive or case insensitive.</para>
469
470 <xi:include href="version-info.xml" xpointer="v237"/></listitem>
471 </varlistentry>
472
473 <varlistentry>
474 <term><option>-k</option></term>
475 <term><option>--dmesg</option></term>
476
477 <listitem><para>Show only kernel messages. This adds the match <literal>_TRANSPORT=kernel</literal>.
478 This implies <option>--boot=0</option> unless explicitly specified otherwise.</para>
479
480 <xi:include href="version-info.xml" xpointer="v205"/></listitem>
481 </varlistentry>
482 </variablelist>
483 </refsect1>
484
485 <refsect1>
486 <title>Output Options</title>
487
488 <para>The following options control how journal records are printed:</para>
489
490 <variablelist>
491 <varlistentry>
492 <term><option>-o</option></term>
493 <term><option>--output=</option></term>
494
495 <listitem><para>Controls the formatting of the journal entries that are shown. Takes one of the
496 following options:</para>
497
498 <variablelist>
499 <varlistentry>
500 <term><option>short</option></term>
501 <listitem><para>is the default and generates an output that is mostly identical to the
502 formatting of classic syslog files, showing one line per journal entry.</para>
503
504 <xi:include href="version-info.xml" xpointer="v206"/></listitem>
505 </varlistentry>
506
507 <varlistentry>
508 <term><option>short-full</option></term>
509 <listitem><para>is very similar, but shows timestamps in the format the
510 <option>--since=</option> and <option>--until=</option> options accept. Unlike the timestamp
511 information shown in <option>short</option> output mode this mode includes weekday, year and
512 timezone information in the output, and is locale-independent.</para>
513
514 <xi:include href="version-info.xml" xpointer="v232"/></listitem>
515 </varlistentry>
516
517 <varlistentry>
518 <term><option>short-iso</option></term>
519 <listitem><para>is very similar, but shows timestamps in the
520 <ulink url="https://tools.ietf.org/html/rfc3339">RFC 3339</ulink> profile of ISO 8601.</para>
521
522 <xi:include href="version-info.xml" xpointer="v206"/></listitem>
523 </varlistentry>
524
525 <varlistentry>
526 <term><option>short-iso-precise</option></term>
527 <listitem><para>as for <option>short-iso</option> but includes full microsecond
528 precision.</para>
529
530 <xi:include href="version-info.xml" xpointer="v234"/></listitem>
531 </varlistentry>
532
533 <varlistentry>
534 <term><option>short-precise</option></term>
535 <listitem><para>is very similar, but shows classic syslog timestamps with full microsecond
536 precision.</para>
537
538 <xi:include href="version-info.xml" xpointer="v207"/></listitem>
539 </varlistentry>
540
541 <varlistentry>
542 <term><option>short-monotonic</option></term>
543 <listitem><para>is very similar, but shows monotonic timestamps instead of wallclock
544 timestamps.</para>
545
546 <xi:include href="version-info.xml" xpointer="v206"/></listitem>
547 </varlistentry>
548
549 <varlistentry>
550 <term><option>short-delta</option></term>
551 <listitem><para>as for <option>short-monotonic</option> but includes the time difference
552 to the previous entry.
553 Maybe unreliable time differences are marked by a <literal>*</literal>.</para>
554
555 <xi:include href="version-info.xml" xpointer="v252"/></listitem>
556 </varlistentry>
557
558 <varlistentry>
559 <term><option>short-unix</option></term>
560 <listitem><para>is very similar, but shows seconds passed since January 1st 1970 UTC instead of
561 wallclock timestamps ("UNIX time"). The time is shown with microsecond accuracy.</para>
562
563 <xi:include href="version-info.xml" xpointer="v230"/></listitem>
564 </varlistentry>
565
566 <varlistentry>
567 <term><option>verbose</option></term>
568 <listitem><para>shows the full-structured entry items with all fields.</para>
569
570 <xi:include href="version-info.xml" xpointer="v206"/></listitem>
571 </varlistentry>
572
573 <varlistentry>
574 <term><option>export</option></term>
575 <listitem><para>serializes the journal into a binary (but mostly text-based) stream suitable
576 for backups and network transfer (see <ulink
577 url="https://systemd.io/JOURNAL_EXPORT_FORMATS#journal-export-format">Journal Export
578 Format</ulink> for more information). To import the binary stream back into native journald
579 format use
580 <citerefentry><refentrytitle>systemd-journal-remote</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
581
582 <xi:include href="version-info.xml" xpointer="v206"/></listitem>
583 </varlistentry>
584
585 <varlistentry>
586 <term><option>json</option></term>
587 <listitem><para>formats entries as JSON objects, separated by newline characters (see <ulink
588 url="https://systemd.io/JOURNAL_EXPORT_FORMATS#journal-json-format">Journal JSON Format</ulink>
589 for more information). Field values are generally encoded as JSON strings, with three exceptions:
590 <orderedlist>
591 <listitem><para>Fields larger than 4096 bytes are encoded as <constant>null</constant>
592 values. (This may be turned off by passing <option>--all</option>, but be aware that this may
593 allocate overly long JSON objects.)</para></listitem>
594
595 <listitem><para>Journal entries permit non-unique fields within the same log entry. JSON does
596 not allow non-unique fields within objects. Due to this, if a non-unique field is encountered a
597 JSON array is used as field value, listing all field values as elements.</para></listitem>
598
599 <listitem><para>Fields containing non-printable or non-UTF8 bytes are encoded as arrays
600 containing the raw bytes individually formatted as unsigned numbers.</para></listitem>
601 </orderedlist>
602
603 Note that this encoding is reversible (with the exception of the size limit).</para>
604
605 <xi:include href="version-info.xml" xpointer="v206"/></listitem>
606 </varlistentry>
607
608 <varlistentry>
609 <term><option>json-pretty</option></term>
610 <listitem><para>formats entries as JSON data structures, but formats them in multiple lines in
611 order to make them more readable by humans.</para>
612
613 <xi:include href="version-info.xml" xpointer="v206"/></listitem>
614 </varlistentry>
615
616 <varlistentry>
617 <term><option>json-sse</option></term>
618 <listitem><para>formats entries as JSON data structures, but wraps them in a format suitable for
619 <ulink
620 url="https://developer.mozilla.org/en-US/docs/Server-sent_events/Using_server-sent_events">Server-Sent
621 Events</ulink>.</para>
622
623 <xi:include href="version-info.xml" xpointer="v206"/></listitem>
624 </varlistentry>
625
626 <varlistentry>
627 <term><option>json-seq</option></term>
628 <listitem><para>formats entries as JSON data structures, but prefixes them with an ASCII Record
629 Separator character (0x1E) and suffixes them with an ASCII Line Feed character (0x0A), in
630 accordance with <ulink url="https://tools.ietf.org/html/rfc7464">JavaScript Object Notation
631 (JSON) Text Sequences </ulink> (<literal>application/json-seq</literal>).</para>
632
633 <xi:include href="version-info.xml" xpointer="v240"/></listitem>
634 </varlistentry>
635
636 <varlistentry>
637 <term><option>cat</option></term>
638 <listitem><para>generates a very terse output, only showing the actual message of each journal
639 entry with no metadata, not even a timestamp. If combined with the
640 <option>--output-fields=</option> option will output the listed fields for each log record,
641 instead of the message.</para>
642
643 <xi:include href="version-info.xml" xpointer="v206"/></listitem>
644 </varlistentry>
645
646 <varlistentry>
647 <term><option>with-unit</option></term>
648 <listitem><para>similar to <option>short-full</option>, but prefixes the unit and user unit names
649 instead of the traditional syslog identifier. Useful when using templated instances, as it will
650 include the arguments in the unit names.</para>
651
652 <xi:include href="version-info.xml" xpointer="v239"/></listitem>
653 </varlistentry>
654 </variablelist></listitem>
655 </varlistentry>
656
657 <varlistentry>
658 <term><option>--truncate-newline</option></term>
659
660 <listitem><para>Truncate each log message at the first newline character on output, so that only the
661 first line of each message is displayed.</para>
662
663 <xi:include href="version-info.xml" xpointer="v254"/></listitem>
664 </varlistentry>
665
666 <varlistentry>
667 <term><option>--output-fields=</option></term>
668
669 <listitem><para>A comma separated list of the fields which should be included in the output. This
670 has an effect only for the output modes which would normally show all fields
671 (<option>verbose</option>, <option>export</option>, <option>json</option>,
672 <option>json-pretty</option>, <option>json-sse</option> and <option>json-seq</option>), as well as
673 on <option>cat</option>. For the former, the <literal>__CURSOR</literal>,
674 <literal>__REALTIME_TIMESTAMP</literal>, <literal>__MONOTONIC_TIMESTAMP</literal>, and
675 <literal>_BOOT_ID</literal> fields are always printed.</para>
676
677 <xi:include href="version-info.xml" xpointer="v236"/></listitem>
678 </varlistentry>
679
680 <varlistentry>
681 <term><option>-n</option></term>
682 <term><option>--lines=</option></term>
683
684 <listitem><para>Show the most recent journal events and limit the number of events shown. The argument
685 is a positive integer or <literal>all</literal> to disable the limit. Additionally, if the number is
686 prefixed with <literal>+</literal>, the oldest journal events are used instead. The default value is
687 10 if no argument is given.</para>
688
689 <para>If <option>--follow</option> is used, this option is implied. When not prefixed with <literal>+</literal>
690 and used with <option>--grep=</option>, <option>--reverse</option> is implied.</para></listitem>
691 </varlistentry>
692
693 <varlistentry>
694 <term><option>-r</option></term>
695 <term><option>--reverse</option></term>
696
697 <listitem><para>Reverse output so that the newest entries are displayed first.</para>
698
699 <xi:include href="version-info.xml" xpointer="v198"/></listitem>
700 </varlistentry>
701
702 <varlistentry>
703 <term><option>--show-cursor</option></term>
704
705 <listitem><para>The cursor is shown after the last entry after two dashes:</para>
706 <programlisting>-- cursor: s=0639…</programlisting>
707 <para>The format of the cursor is private and subject to change.</para>
708
709 <xi:include href="version-info.xml" xpointer="v209"/></listitem>
710 </varlistentry>
711
712 <varlistentry>
713 <term><option>--utc</option></term>
714
715 <listitem><para>Express time in Coordinated Universal Time (UTC).</para>
716
717 <xi:include href="version-info.xml" xpointer="v217"/></listitem>
718 </varlistentry>
719
720 <varlistentry>
721 <term><option>-x</option></term>
722 <term><option>--catalog</option></term>
723
724 <listitem><para>Augment log lines with explanation texts from the message catalog. This will add
725 explanatory help texts to log messages in the output where this is available. These short help texts
726 will explain the context of an error or log event, possible solutions, as well as pointers to support
727 forums, developer documentation, and any other relevant manuals. Note that help texts are not
728 available for all messages, but only for selected ones. For more information on the message catalog,
729 see <ulink url="https://systemd.io/CATALOG">Journal Message Catalogs</ulink>.</para>
730
731 <para>Note: when attaching <command>journalctl</command> output to bug reports, please do
732 <emphasis>not</emphasis> use <option>-x</option>.</para>
733
734 <xi:include href="version-info.xml" xpointer="v196"/></listitem>
735 </varlistentry>
736
737 <varlistentry>
738 <term><option>-W</option></term>
739 <term><option>--no-hostname</option></term>
740
741 <listitem><para>Do not show the hostname field of log messages. This switch has an effect only on the
742 <option>short</option> family of output modes (see above).</para>
743
744 <para>Note: this option does not remove occurrences of the hostname from log entries themselves, so
745 it does not prevent the hostname from being visible in the logs.</para>
746
747 <xi:include href="version-info.xml" xpointer="v230"/></listitem>
748 </varlistentry>
749
750 <varlistentry>
751 <term><option>--no-full</option></term>
752 <term><option>--full</option></term>
753 <term><option>-l</option></term>
754
755 <listitem><para>Ellipsize fields when they do not fit in available columns. The default is to show
756 full fields, allowing them to wrap or be truncated by the pager, if one is used.</para>
757
758 <para>The old options <option>-l</option>/<option>--full</option> are not useful anymore, except to
759 undo <option>--no-full</option>.</para>
760
761 <xi:include href="version-info.xml" xpointer="v196"/></listitem>
762 </varlistentry>
763
764 <varlistentry>
765 <term><option>-a</option></term>
766 <term><option>--all</option></term>
767
768 <listitem><para>Show all fields in full, even if they include unprintable characters or are very
769 long. By default, fields with unprintable characters are abbreviated as "blob data". (Note that the
770 pager may escape unprintable characters again.)</para></listitem>
771 </varlistentry>
772
773 <varlistentry>
774 <term><option>-f</option></term>
775 <term><option>--follow</option></term>
776
777 <listitem><para>Show only the most recent journal entries, and continuously print new entries as they
778 are appended to the journal, until Ctrl-C is hit (or the tool is otherwise terminated).</para>
779
780 <para><command>journalctl</command> will send an
781 <citerefentry><refentrytitle>sd_notify</refentrytitle><manvolnum>3</manvolnum></citerefentry>
782 <literal>READY=1</literal> message once it initialized and successfully established its watch on the
783 journal.</para></listitem>
784 </varlistentry>
785
786 <varlistentry>
787 <term><option>--no-tail</option></term>
788
789 <listitem><para>Show all stored output lines, even in follow mode. Undoes the effect of
790 <option>--lines=</option>.</para></listitem>
791 </varlistentry>
792
793 <varlistentry>
794 <term><option>-q</option></term>
795 <term><option>--quiet</option></term>
796
797 <listitem><para>Suppresses all informational messages (i.e. "-- Journal begins at …", "-- Reboot
798 --"), any warning messages regarding inaccessible system journals when run as a normal
799 user.</para></listitem>
800 </varlistentry>
801
802 <varlistentry>
803 <term><option>--synchronize-on-exit=</option></term>
804
805 <listitem><para>Takes a boolean argument. If true and operating in <option>--follow</option> mode, a
806 journal synchronization request (equivalent to <command>journalctl --sync</command>) is issued when
807 <constant>SIGTERM</constant>/<constant>SIGINT</constant> is received, and log output continues until
808 this request completes. This is useful for synchronizing journal log output to the runtime of
809 services or external events, ensuring that any log data enqueued to the logging subsystem by
810 the time <constant>SIGTERM</constant>/<constant>SIGINT</constant> is issued is guaranteed to be
811 processed and displayed by the time log output ends. Defaults to false.</para>
812
813 <xi:include href="version-info.xml" xpointer="v258"/></listitem>
814 </varlistentry>
815 </variablelist>
816 </refsect1>
817
818 <refsect1>
819 <title>Pager Control Options</title>
820
821 <para>The following options control page support:</para>
822
823 <variablelist>
824
825 <xi:include href="standard-options.xml" xpointer="no-pager" />
826
827 <varlistentry>
828 <term><option>-e</option></term>
829 <term><option>--pager-end</option></term>
830
831 <listitem><para>Immediately jump to the end of the journal inside the implied pager tool. This
832 implies <option>--lines=1000</option> and <option>--boot=0</option> unless explicitly specified
833 otherwise, to guarantee that the pager will not buffer logs of unbounded size. Note that this option
834 is only supported for the
835 <citerefentry project='man-pages'><refentrytitle>less</refentrytitle><manvolnum>1</manvolnum></citerefentry>
836 pager.</para>
837
838 <xi:include href="version-info.xml" xpointer="v198"/></listitem>
839 </varlistentry>
840 </variablelist>
841 </refsect1>
842
843 <refsect1>
844 <title>Forward Secure Sealing (FSS) Options</title>
845
846 <para>The following options may be used together with the <option>--setup-keys</option> command described
847 below:</para>
848
849 <variablelist>
850 <varlistentry>
851 <term><option>--interval=</option></term>
852
853 <listitem><para>Specifies the change interval for the sealing key when generating an FSS key pair
854 with <option>--setup-keys</option>. Shorter intervals increase CPU consumption but shorten the time
855 range of undetectable journal alterations. Defaults to 15min.</para>
856
857 <para>Note, <option>--output=json-sse</option> and <option>--output=json-seq</option> are silently
858 migrated to <option>--output=json</option>.</para>
859
860 <xi:include href="version-info.xml" xpointer="v189"/></listitem>
861 </varlistentry>
862
863 <varlistentry>
864 <term><option>--verify-key=</option></term>
865
866 <listitem><para>Specifies the FSS verification key to use for the <option>--verify</option>
867 operation.</para>
868
869 <xi:include href="version-info.xml" xpointer="v189"/></listitem>
870 </varlistentry>
871
872 <varlistentry>
873 <term><option>--force</option></term>
874
875 <listitem><para>When <option>--setup-keys</option> is passed and Forward Secure Sealing (FSS) has
876 already been configured, recreate FSS keys.</para>
877
878 <xi:include href="version-info.xml" xpointer="v206"/></listitem>
879 </varlistentry>
880 </variablelist>
881 </refsect1>
882
883 <refsect1>
884 <title>Commands</title>
885
886 <para>The following commands are understood. If none is specified the default is to display journal records:</para>
887
888 <variablelist>
889 <varlistentry>
890 <term><option>-N</option></term>
891 <term><option>--fields</option></term>
892
893 <listitem><para>Print all field names currently used in all entries of the journal.</para>
894
895 <xi:include href="version-info.xml" xpointer="v229"/></listitem>
896 </varlistentry>
897
898 <varlistentry>
899 <term><option>-F</option></term>
900 <term><option>--field=</option></term>
901
902 <listitem><para>Print all possible data values the specified field can take in all entries of the
903 journal.</para>
904
905 <xi:include href="version-info.xml" xpointer="v195"/></listitem>
906 </varlistentry>
907
908 <varlistentry>
909 <term><option>--list-boots</option></term>
910
911 <listitem>
912 <para>Show a tabular list of boot numbers (relative to the current boot), their IDs, and the
913 timestamps of the first and last message pertaining to the boot. When specified with
914 <option>-n/--lines=<optional>+</optional><replaceable>N</replaceable></option> option, only the
915 first (when the number prefixed with <literal>+</literal>) or the last (without prefix)
916 <replaceable>N</replaceable> entries will be shown. When specified with
917 <option>-r/--reverse</option>, the list will be shown in the reverse order.</para>
918
919 <xi:include href="version-info.xml" xpointer="v209"/>
920 </listitem>
921 </varlistentry>
922
923 <varlistentry>
924 <term><option>--list-invocations</option></term>
925
926 <listitem>
927 <para>List invocation IDs of a unit. Requires a unit name with <option>-u/--unit=</option> or
928 <option>--user-unit=</option>. Show a tabular list of invocation numbers (relative to the current
929 or latest invocation), their IDs, and the timestamps of the first and last message pertaining to
930 the invocation. When <option>-b/-boot</option> is specified, invocations in the boot will be shown.
931 When specified with <option>-n/--lines=<optional>+</optional><replaceable>N</replaceable></option>
932 option, only the first (when the number prefixed with <literal>+</literal>) or the last (without
933 prefix) <replaceable>N</replaceable> entries will be shown. When specified with
934 <option>-r/--reverse</option>, the list will be shown in the reverse order.</para>
935
936 <xi:include href="version-info.xml" xpointer="v257"/>
937 </listitem>
938 </varlistentry>
939
940 <varlistentry>
941 <term><option>--disk-usage</option></term>
942
943 <listitem><para>Shows the current disk usage of all journal files. This shows the sum of the disk
944 usage of all archived and active journal files.</para>
945
946 <xi:include href="version-info.xml" xpointer="v190"/></listitem>
947 </varlistentry>
948
949 <varlistentry>
950 <term><option>--vacuum-size=</option></term>
951 <term><option>--vacuum-time=</option></term>
952 <term><option>--vacuum-files=</option></term>
953
954 <listitem><para><option>--vacuum-size=</option> removes the oldest archived journal files until the
955 disk space they use falls below the specified size. Accepts the usual <literal>K</literal>,
956 <literal>M</literal>, <literal>G</literal> and <literal>T</literal> suffixes (to the base of
957 1024).</para>
958
959 <para><option>--vacuum-time=</option> removes archived journal files older than the specified
960 timespan. Accepts the usual <literal>s</literal> (default), <literal>m</literal>,
961 <literal>h</literal>, <literal>days</literal>, <literal>weeks</literal>, <literal>months</literal>,
962 and <literal>years</literal> suffixes, see
963 <citerefentry><refentrytitle>systemd.time</refentrytitle><manvolnum>7</manvolnum></citerefentry> for
964 details.</para>
965
966 <para><option>--vacuum-files=</option> leaves only the specified number of separate journal
967 files.</para>
968
969 <para>Note that running <option>--vacuum-size=</option> has only an indirect effect on the output
970 shown by <option>--disk-usage</option>, as the latter includes active journal files, while the
971 vacuuming operation only operates on archived journal files. Similarly,
972 <option>--vacuum-files=</option> might not actually reduce the number of journal files to below the
973 specified number, as it will not remove active journal files.</para>
974
975 <para><option>--vacuum-size=</option>, <option>--vacuum-time=</option> and
976 <option>--vacuum-files=</option> may be combined in a single invocation to enforce any combination of
977 a size, a time and a number of files limit on the archived journal files. Specifying any of these
978 three parameters as zero is equivalent to not enforcing the specific limit, and is thus
979 redundant.</para>
980
981 <para>These three switches may also be combined with <option>--rotate</option> into one command. If
982 so, all active files are rotated first, and the requested vacuuming operation is executed right
983 after. The rotation has the effect that all currently active files are archived (and potentially new,
984 empty journal files opened as replacement), and hence the vacuuming operation has the greatest effect
985 as it can take all log data written so far into account.</para>
986
987 <xi:include href="version-info.xml" xpointer="v218"/></listitem>
988 </varlistentry>
989
990 <varlistentry>
991 <term><option>--verify</option></term>
992
993 <listitem><para>Check the journal file for internal consistency. If the file has been generated
994 with FSS enabled and the FSS verification key has been specified with
995 <option>--verify-key=</option>, authenticity of the journal file is verified.</para>
996
997 <xi:include href="version-info.xml" xpointer="v189"/></listitem>
998 </varlistentry>
999
1000 <varlistentry>
1001 <term><option>--sync</option></term>
1002
1003 <listitem><para>Asks the journal daemon to write all yet unwritten journal data to the backing file
1004 system and synchronize all journals. This call does not return until the synchronization operation
1005 is complete. This command guarantees that any log messages written before its invocation are safely
1006 stored on disk at the time it returns.</para>
1007
1008 <xi:include href="version-info.xml" xpointer="v228"/></listitem>
1009 </varlistentry>
1010
1011 <varlistentry>
1012 <term><option>--relinquish-var</option></term>
1013
1014 <listitem><para>Asks the journal daemon for the reverse operation to <option>--flush</option>: if
1015 requested the daemon will write further log data to <filename>/run/log/journal/</filename> and
1016 stops writing to <filename>/var/log/journal/</filename>. A subsequent call to
1017 <option>--flush</option> causes the log output to switch back to
1018 <filename>/var/log/journal/</filename>, see above.</para>
1019
1020 <xi:include href="version-info.xml" xpointer="v243"/></listitem>
1021 </varlistentry>
1022
1023 <varlistentry>
1024 <term><option>--smart-relinquish-var</option></term>
1025
1026 <listitem><para>Similar to <option>--relinquish-var</option>, but executes no operation if the root
1027 file system and <filename>/var/log/journal/</filename> reside on the same mount point. This operation
1028 is used during system shutdown in order to make the journal daemon stop writing data to
1029 <filename>/var/log/journal/</filename> in case that directory is located on a mount point that needs
1030 to be unmounted.</para>
1031
1032 <xi:include href="version-info.xml" xpointer="v243"/></listitem>
1033 </varlistentry>
1034
1035 <varlistentry>
1036 <term><option>--flush</option></term>
1037
1038 <listitem><para>Asks the journal daemon to flush any log data stored in
1039 <filename>/run/log/journal/</filename> into <filename>/var/log/journal/</filename>, if persistent
1040 storage is enabled. This call does not return until the operation is complete. Note that this call is
1041 idempotent: the data is only flushed from <filename>/run/log/journal/</filename> into
1042 <filename>/var/log/journal/</filename> once during system runtime (but see
1043 <option>--relinquish-var</option> below), and this command exits cleanly without executing any
1044 operation if this has already happened. This command effectively guarantees that all data is flushed
1045 to <filename>/var/log/journal/</filename> at the time it returns.</para>
1046
1047 <xi:include href="version-info.xml" xpointer="v217"/></listitem>
1048 </varlistentry>
1049
1050 <varlistentry>
1051 <term><option>--rotate</option></term>
1052
1053 <listitem><para>Asks the journal daemon to rotate journal files. This call does not return until
1054 the rotation operation is complete. Journal file rotation has the effect that all currently active
1055 journal files are marked as archived and renamed, so that they are never written to in future. New
1056 (empty) journal files are then created in their place. This operation may be combined with
1057 <option>--vacuum-size=</option>, <option>--vacuum-time=</option> and
1058 <option>--vacuum-file=</option> into a single command, see above.</para>
1059
1060 <xi:include href="version-info.xml" xpointer="v227"/></listitem>
1061 </varlistentry>
1062
1063 <varlistentry>
1064 <term><option>--header</option></term>
1065
1066 <listitem><para>Instead of showing journal contents, show internal header information of the
1067 journal fields accessed.</para>
1068
1069 <para>This option is particularly useful when trying to identify out-of-order journal entries, as
1070 happens for example when the machine is booted with the wrong system time.</para>
1071
1072 <xi:include href="version-info.xml" xpointer="v187"/></listitem>
1073 </varlistentry>
1074
1075 <varlistentry>
1076 <term><option>--list-catalog <optional><replaceable>128-bit-ID…</replaceable></optional></option></term>
1077
1078 <listitem><para>List the contents of the message catalog as a table of message IDs, plus their
1079 short description strings.</para>
1080
1081 <para>If any <replaceable>128-bit-ID</replaceable>s are specified, only those entries are
1082 shown.</para>
1083
1084 <xi:include href="version-info.xml" xpointer="v196"/></listitem>
1085 </varlistentry>
1086
1087 <varlistentry>
1088 <term><option>--dump-catalog <optional><replaceable>128-bit-ID…</replaceable></optional></option></term>
1089
1090 <listitem><para>Show the contents of the message catalog, with entries separated by a line
1091 consisting of two dashes and the ID (the format is the same as <filename>.catalog</filename>
1092 files).</para>
1093
1094 <para>If any <replaceable>128-bit-ID</replaceable>s are specified, only those entries are
1095 shown.</para>
1096
1097 <xi:include href="version-info.xml" xpointer="v199"/></listitem>
1098 </varlistentry>
1099
1100 <varlistentry>
1101 <term><option>--update-catalog</option></term>
1102
1103 <listitem><para>Update the message catalog index. This command needs to be executed each time new
1104 catalog files are installed, removed, or updated to rebuild the binary catalog
1105 index.</para>
1106
1107 <xi:include href="version-info.xml" xpointer="v196"/></listitem>
1108 </varlistentry>
1109
1110 <varlistentry>
1111 <term><option>--setup-keys</option></term>
1112
1113 <listitem><para>Instead of showing journal contents, generate a new key pair for Forward Secure
1114 Sealing (FSS). This will generate a sealing key and a verification key. The sealing key is stored in
1115 the journal data directory and shall remain on the host. The verification key should be stored
1116 externally. Refer to the <option>Seal=</option> option in
1117 <citerefentry><refentrytitle>journald.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry> for
1118 information on Forward Secure Sealing and for a link to a refereed scholarly paper detailing the
1119 cryptographic theory it is based on.</para>
1120
1121 <xi:include href="version-info.xml" xpointer="v189"/></listitem>
1122 </varlistentry>
1123
1124 <xi:include href="standard-options.xml" xpointer="help" />
1125 <xi:include href="standard-options.xml" xpointer="version" />
1126 </variablelist>
1127 </refsect1>
1128
1129 <refsect1>
1130 <title>Exit status</title>
1131
1132 <para>On success, 0 is returned; otherwise, a non-zero failure code is returned.</para>
1133 </refsect1>
1134
1135 <xi:include href="common-variables.xml" />
1136
1137 <refsect1>
1138 <title>Examples</title>
1139
1140 <para>Without arguments, all collected logs are shown unfiltered:</para>
1141
1142 <programlisting>journalctl</programlisting>
1143
1144 <para>With one match specified, all entries with a field matching the expression are shown:</para>
1145
1146 <programlisting>journalctl _SYSTEMD_UNIT=avahi-daemon.service
1147 journalctl _SYSTEMD_CGROUP=/user.slice/user-42.slice/session-c1.scope</programlisting>
1148
1149 <para>If two different fields are matched, only entries matching both expressions at the same time are
1150 shown:</para>
1151
1152 <programlisting>journalctl _SYSTEMD_UNIT=avahi-daemon.service _PID=28097</programlisting>
1153
1154 <para>If two matches refer to the same field, all entries matching either expression are shown:</para>
1155
1156 <programlisting>journalctl _SYSTEMD_UNIT=avahi-daemon.service _SYSTEMD_UNIT=dbus.service</programlisting>
1157
1158 <para>If the separator <literal>+</literal> is used, two expressions may be combined in a logical OR. The
1159 following will show all messages from the Avahi service process with the PID 28097 plus all messages from
1160 the D-Bus service (from any of its processes):</para>
1161
1162 <programlisting>journalctl _SYSTEMD_UNIT=avahi-daemon.service _PID=28097 + _SYSTEMD_UNIT=dbus.service</programlisting>
1163
1164 <para>To show all fields emitted <emphasis>by</emphasis> a unit and <emphasis>about</emphasis> the unit,
1165 option <option>-u</option>/<option>--unit=</option> should be used. <command>journalctl -u
1166 <replaceable>name</replaceable></command> expands to a complex filter similar to
1167
1168 <programlisting>_SYSTEMD_UNIT=<replaceable>name</replaceable>.service
1169 + UNIT=<replaceable>name</replaceable>.service _PID=1
1170 + OBJECT_SYSTEMD_UNIT=<replaceable>name</replaceable>.service _UID=0
1171 + COREDUMP_UNIT=<replaceable>name</replaceable>.service _UID=0 MESSAGE_ID=fc2e22bc6ee647b6b90729ab34a250b1</programlisting>
1172
1173 (see
1174 <citerefentry><refentrytitle>systemd.journal-fields</refentrytitle><manvolnum>7</manvolnum></citerefentry>
1175 for an explanation of those patterns).</para>
1176
1177 <para>Show all logs generated by the D-Bus executable:</para>
1178
1179 <programlisting>journalctl /usr/bin/dbus-daemon</programlisting>
1180
1181 <para>Show all kernel logs from previous boot:</para>
1182
1183 <programlisting>journalctl -k -b -1</programlisting>
1184
1185 <para>Show a live log display from a system service <filename>apache.service</filename>:</para>
1186
1187 <programlisting>journalctl -f -u apache</programlisting>
1188 </refsect1>
1189
1190 <refsect1>
1191 <title>See Also</title>
1192 <para><simplelist type="inline">
1193 <member><citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry></member>
1194 <member><citerefentry><refentrytitle>systemd-cat</refentrytitle><manvolnum>1</manvolnum></citerefentry></member>
1195 <member><citerefentry><refentrytitle>systemd-journald.service</refentrytitle><manvolnum>8</manvolnum></citerefentry></member>
1196 <member><citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry></member>
1197 <member><citerefentry><refentrytitle>coredumpctl</refentrytitle><manvolnum>1</manvolnum></citerefentry></member>
1198 <member><citerefentry><refentrytitle>systemd.journal-fields</refentrytitle><manvolnum>7</manvolnum></citerefentry></member>
1199 <member><citerefentry><refentrytitle>journald.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry></member>
1200 <member><citerefentry><refentrytitle>systemd.time</refentrytitle><manvolnum>7</manvolnum></citerefentry></member>
1201 <member><citerefentry><refentrytitle>systemd-journal-remote.service</refentrytitle><manvolnum>8</manvolnum></citerefentry></member>
1202 <member><citerefentry><refentrytitle>systemd-journal-upload.service</refentrytitle><manvolnum>8</manvolnum></citerefentry></member>
1203 </simplelist></para>
1204 </refsect1>
1205 </refentry>