1 <?xml version='
1.0'
?> <!--*-nxml-*-->
2 <!DOCTYPE refentry PUBLIC
"-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
6 SPDX-License-Identifier: LGPL-2.1+
9 <refentry id=
"journalctl"
10 xmlns:
xi=
"http://www.w3.org/2001/XInclude">
13 <title>journalctl
</title>
14 <productname>systemd
</productname>
18 <refentrytitle>journalctl
</refentrytitle>
19 <manvolnum>1</manvolnum>
23 <refname>journalctl
</refname>
24 <refpurpose>Query the systemd journal
</refpurpose>
29 <command>journalctl
</command>
30 <arg choice=
"opt" rep=
"repeat">OPTIONS
</arg>
31 <arg choice=
"opt" rep=
"repeat">MATCHES
</arg>
36 <title>Description
</title>
38 <para><command>journalctl
</command> may be used to query the
40 <citerefentry><refentrytitle>systemd
</refentrytitle><manvolnum>1</manvolnum></citerefentry>
42 <citerefentry><refentrytitle>systemd-journald.service
</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
</para>
44 <para>If called without parameters, it will show the full
45 contents of the journal, starting with the oldest entry
48 <para>If one or more match arguments are passed, the output is
49 filtered accordingly. A match is in the format
50 <literal>FIELD=VALUE
</literal>,
51 e.g.
<literal>_SYSTEMD_UNIT=httpd.service
</literal>, referring
52 to the components of a structured journal entry. See
53 <citerefentry><refentrytitle>systemd.journal-fields
</refentrytitle><manvolnum>7</manvolnum></citerefentry>
54 for a list of well-known fields. If multiple matches are
55 specified matching different fields, the log entries are
56 filtered by both, i.e. the resulting output will show only
57 entries matching all the specified matches of this kind. If two
58 matches apply to the same field, then they are automatically
59 matched as alternatives, i.e. the resulting output will show
60 entries matching any of the specified matches for the same
61 field. Finally, the character
<literal>+
</literal> may appear
62 as a separate word between other terms on the command line. This
63 causes all matches before and after to be combined in a
64 disjunction (i.e. logical OR).
</para>
66 <para>It is also possible to filter the entries by specifying an
67 absolute file path as an argument. The file path may be a file or
68 a symbolic link and the file must exist at the time of the query. If a
69 file path refers to an executable binary, an
<literal>_EXE=
</literal>
70 match for the canonicalized binary path is added to the query. If a
71 file path refers to an executable script, a
<literal>_COMM=
</literal>
72 match for the script name is added to the query. If a file path
73 refers to a device node,
<literal>_KERNEL_DEVICE=
</literal> matches for
74 the kernel name of the device and for each of its ancestor devices is
75 added to the query. Symbolic links are dereferenced, kernel names are
76 synthesized, and parent devices are identified from the environment at
77 the time of the query. In general, a device node is the best proxy for
78 an actual device, as log entries do not usually contain fields that
79 identify an actual device. For the resulting log entries to be correct
80 for the actual device, the relevant parts of the environment at the time
81 the entry was logged, in particular the actual device corresponding to
82 the device node, must have been the same as those at the time of the
83 query. Because device nodes generally change their corresponding devices
84 across reboots, specifying a device node path causes the resulting
85 entries to be restricted to those from the current boot.
</para>
87 <para>Additional constraints may be added using options
88 <option>--boot
</option>,
<option>--unit=
</option>, etc., to
89 further limit what entries will be shown (logical AND).
</para>
91 <para>Output is interleaved from all accessible journal files,
92 whether they are rotated or currently being written, and
93 regardless of whether they belong to the system itself or are
94 accessible user journals.
</para>
96 <para>The set of journal files which will be used can be
97 modified using the
<option>--user
</option>,
98 <option>--system
</option>,
<option>--directory
</option>, and
99 <option>--file
</option> options, see below.
</para>
101 <para>All users are granted access to their private per-user
102 journals. However, by default, only root and users who are
103 members of a few special groups are granted access to the system
104 journal and the journals of other users. Members of the groups
105 <literal>systemd-journal
</literal>,
<literal>adm
</literal>, and
106 <literal>wheel
</literal> can read all journal files. Note
107 that the two latter groups traditionally have additional
108 privileges specified by the distribution. Members of the
109 <literal>wheel
</literal> group can often perform administrative
112 <para>The output is paged through
<command>less
</command> by
113 default, and long lines are
"truncated" to screen width. The
114 hidden part can be viewed by using the left-arrow and
115 right-arrow keys. Paging can be disabled; see the
116 <option>--no-pager
</option> option and the
"Environment" section
119 <para>When outputting to a tty, lines are colored according to
120 priority: lines of level ERROR and higher are colored red; lines
121 of level NOTICE and higher are highlighted; other lines are
122 displayed normally.
</para>
126 <title>Options
</title>
128 <para>The following options are understood:
</para>
132 <term><option>--no-full
</option></term>
133 <term><option>--full
</option></term>
134 <term><option>-l
</option></term>
136 <listitem><para>Ellipsize fields when they do not fit in
137 available columns. The default is to show full fields,
138 allowing them to wrap or be truncated by the pager, if one
141 <para>The old options
142 <option>-l
</option>/
<option>--full
</option> are not useful
143 anymore, except to undo
<option>--no-full
</option>.
</para>
148 <term><option>-a
</option></term>
149 <term><option>--all
</option></term>
151 <listitem><para>Show all fields in full, even if they
152 include unprintable characters or are very
153 long.
</para></listitem>
157 <term><option>-f
</option></term>
158 <term><option>--follow
</option></term>
160 <listitem><para>Show only the most recent journal entries,
161 and continuously print new entries as they are appended to
162 the journal.
</para></listitem>
166 <term><option>-e
</option></term>
167 <term><option>--pager-end
</option></term>
169 <listitem><para>Immediately jump to the end of the journal
170 inside the implied pager tool. This implies
171 <option>-n1000
</option> to guarantee that the pager will not
172 buffer logs of unbounded size. This may be overridden with
173 an explicit
<option>-n
</option> with some other numeric
174 value, while
<option>-nall
</option> will disable this cap.
175 Note that this option is only supported for the
176 <citerefentry project='man-pages'
><refentrytitle>less
</refentrytitle><manvolnum>1</manvolnum></citerefentry>
177 pager.
</para></listitem>
181 <term><option>-n
</option></term>
182 <term><option>--lines=
</option></term>
184 <listitem><para>Show the most recent journal events and
185 limit the number of events shown. If
186 <option>--follow
</option> is used, this option is
187 implied. The argument is a positive integer or
188 <literal>all
</literal> to disable line limiting. The default
189 value is
10 if no argument is given.
</para></listitem>
193 <term><option>--no-tail
</option></term>
195 <listitem><para>Show all stored output lines, even in follow
196 mode. Undoes the effect of
<option>--lines=
</option>.
201 <term><option>-r
</option></term>
202 <term><option>--reverse
</option></term>
204 <listitem><para>Reverse output so that the newest entries
205 are displayed first.
</para></listitem>
209 <term><option>-o
</option></term>
210 <term><option>--output=
</option></term>
212 <listitem><para>Controls the formatting of the journal
213 entries that are shown. Takes one of the following
218 <option>short
</option>
221 <para>is the default and generates an output that is
222 mostly identical to the formatting of classic syslog
223 files, showing one line per journal entry.
</para>
229 <option>short-full
</option>
232 <para>is very similar, but shows timestamps in the format the
<option>--since=
</option> and
233 <option>--until=
</option> options accept. Unlike the timestamp information shown in
234 <option>short
</option> output mode this mode includes weekday, year and timezone information in the
235 output, and is locale-independent.
</para>
241 <option>short-iso
</option>
244 <para>is very similar, but shows ISO
8601 wallclock
251 <option>short-iso-precise
</option>
254 <para>as for
<option>short-iso
</option> but includes full
255 microsecond precision.
</para>
261 <option>short-precise
</option>
264 <para>is very similar, but shows classic syslog timestamps
265 with full microsecond precision.
</para>
271 <option>short-monotonic
</option>
274 <para>is very similar, but shows monotonic timestamps
275 instead of wallclock timestamps.
</para>
281 <option>short-unix
</option>
284 <para>is very similar, but shows seconds passed since January
1st
1970 UTC instead of wallclock
285 timestamps (
"UNIX time"). The time is shown with microsecond accuracy.
</para>
291 <option>verbose
</option>
294 <para>shows the full-structured entry items with all
301 <option>export
</option>
304 <para>serializes the journal into a binary (but mostly
305 text-based) stream suitable for backups and network
307 <ulink url=
"https://www.freedesktop.org/wiki/Software/systemd/export">Journal Export Format
</ulink>
308 for more information). To import the binary stream back
309 into native journald format use
310 <citerefentry><refentrytitle>systemd-journal-remote
</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
</para>
316 <option>json
</option>
319 <para>formats entries as JSON data structures, one per
321 <ulink url=
"https://www.freedesktop.org/wiki/Software/systemd/json">Journal JSON Format
</ulink>
322 for more information).
</para>
328 <option>json-pretty
</option>
331 <para>formats entries as JSON data structures, but
332 formats them in multiple lines in order to make them
333 more readable by humans.
</para>
339 <option>json-sse
</option>
342 <para>formats entries as JSON data structures, but wraps
343 them in a format suitable for
344 <ulink url=
"https://developer.mozilla.org/en-US/docs/Server-sent_events/Using_server-sent_events">Server-Sent Events
</ulink>.
354 <para>generates a very terse output, only showing the
355 actual message of each journal entry with no metadata,
356 not even a timestamp.
</para>
362 <option>with-unit
</option>
365 <para>similar to short-full, but prefixes the unit and
366 user unit names instead of the traditional syslog
367 identifier. Useful when using templated instances, as it
368 will include the arguments in the unit names.
</para>
376 <term><option>--output-fields=
</option></term>
378 <listitem><para>A comma separated list of the fields which should
379 be included in the output. This only has an effect for the output modes
380 which would normally show all fields (
<option>verbose
</option>,
381 <option>export
</option>,
<option>json
</option>,
382 <option>json-pretty
</option>, and
<option>json-sse
</option>). The
383 <literal>__CURSOR
</literal>,
<literal>__REALTIME_TIMESTAMP
</literal>,
384 <literal>__MONOTONIC_TIMESTAMP
</literal>, and
385 <literal>_BOOT_ID
</literal> fields are always
386 printed.
</para></listitem>
390 <term><option>--utc
</option></term>
392 <listitem><para>Express time in Coordinated Universal Time
393 (UTC).
</para></listitem>
397 <term><option>--no-hostname
</option></term>
399 <listitem><para>Don't show the hostname field of log messages originating from the local host. This switch only
400 has an effect on the
<option>short
</option> family of output modes (see above).
</para></listitem>
404 <term><option>-x
</option></term>
405 <term><option>--catalog
</option></term>
407 <listitem><para>Augment log lines with explanation texts from
408 the message catalog. This will add explanatory help texts to
409 log messages in the output where this is available. These
410 short help texts will explain the context of an error or log
411 event, possible solutions, as well as pointers to support
412 forums, developer documentation, and any other relevant
413 manuals. Note that help texts are not available for all
414 messages, but only for selected ones. For more information on
415 the message catalog, please refer to the
416 <ulink url=
"https://www.freedesktop.org/wiki/Software/systemd/catalog">Message Catalog Developer Documentation
</ulink>.
</para>
418 <para>Note: when attaching
<command>journalctl
</command>
419 output to bug reports, please do
<emphasis>not
</emphasis> use
420 <option>-x
</option>.
</para>
425 <term><option>-q
</option></term>
426 <term><option>--quiet
</option></term>
428 <listitem><para>Suppresses all informational messages
429 (i.e.
"-- Logs begin at …",
"-- Reboot --"),
430 any warning messages regarding
431 inaccessible system journals when run as a normal
432 user.
</para></listitem>
436 <term><option>-m
</option></term>
437 <term><option>--merge
</option></term>
439 <listitem><para>Show entries interleaved from all available
440 journals, including remote ones.
</para></listitem>
444 <term><option>-b
<optional><replaceable>ID
</replaceable></optional><optional><replaceable>±offset
</replaceable></optional></option></term>
445 <term><option>--boot=
<optional><replaceable>ID
</replaceable></optional><optional><replaceable>±offset
</replaceable></optional></option></term>
447 <listitem><para>Show messages from a specific boot. This will
448 add a match for
<literal>_BOOT_ID=
</literal>.
</para>
450 <para>The argument may be empty, in which case logs for the
451 current boot will be shown.
</para>
453 <para>If the boot ID is omitted, a positive
454 <replaceable>offset
</replaceable> will look up the boots
455 starting from the beginning of the journal, and an
456 equal-or-less-than zero
<replaceable>offset
</replaceable> will
457 look up boots starting from the end of the journal. Thus,
458 <constant>1</constant> means the first boot found in the
459 journal in chronological order,
<constant>2</constant> the
460 second and so on; while
<constant>-
0</constant> is the last
461 boot,
<constant>-
1</constant> the boot before last, and so
462 on. An empty
<replaceable>offset
</replaceable> is equivalent
463 to specifying
<constant>-
0</constant>, except when the current
464 boot is not the last boot (e.g. because
465 <option>--directory
</option> was specified to look at logs
466 from a different machine).
</para>
468 <para>If the
32-character
<replaceable>ID
</replaceable> is
469 specified, it may optionally be followed by
470 <replaceable>offset
</replaceable> which identifies the boot
471 relative to the one given by boot
472 <replaceable>ID
</replaceable>. Negative values mean earlier
473 boots and positive values mean later boots. If
474 <replaceable>offset
</replaceable> is not specified, a value of
475 zero is assumed, and the logs for the boot given by
476 <replaceable>ID
</replaceable> are shown.
</para>
481 <term><option>--list-boots
</option></term>
483 <listitem><para>Show a tabular list of boot numbers (relative to
484 the current boot), their IDs, and the timestamps of the first
485 and last message pertaining to the boot.
</para></listitem>
489 <term><option>-k
</option></term>
490 <term><option>--dmesg
</option></term>
492 <listitem><para>Show only kernel messages. This implies
493 <option>-b
</option> and adds the match
494 <literal>_TRANSPORT=kernel
</literal>.
</para></listitem>
498 <term><option>-t
</option></term>
499 <term><option>--identifier=
<replaceable>SYSLOG_IDENTIFIER
</replaceable></option></term>
501 <listitem><para>Show messages for the specified syslog
503 <replaceable>SYSLOG_IDENTIFIER
</replaceable>.
</para>
505 <para>This parameter can be specified multiple
506 times.
</para></listitem>
510 <term><option>-u
</option></term>
511 <term><option>--unit=
<replaceable>UNIT
</replaceable>|
<replaceable>PATTERN
</replaceable></option></term>
513 <listitem><para>Show messages for the specified systemd unit
514 <replaceable>UNIT
</replaceable> (such as a service unit), or
515 for any of the units matched by
516 <replaceable>PATTERN
</replaceable>. If a pattern is
517 specified, a list of unit names found in the journal is
518 compared with the specified pattern and all that match are
519 used. For each unit name, a match is added for messages from
521 (
<literal>_SYSTEMD_UNIT=
<replaceable>UNIT
</replaceable></literal>),
522 along with additional matches for messages from systemd and
523 messages about coredumps for the specified unit.
</para>
525 <para>This parameter can be specified multiple times.
</para>
530 <term><option>--user-unit=
</option></term>
532 <listitem><para>Show messages for the specified user session
533 unit. This will add a match for messages from the unit
534 (
<literal>_SYSTEMD_USER_UNIT=
</literal> and
535 <literal>_UID=
</literal>) and additional matches for messages
536 from session systemd and messages about coredumps for the
537 specified unit.
</para>
539 <para>This parameter can be specified multiple times.
</para>
544 <term><option>-p
</option></term>
545 <term><option>--priority=
</option></term>
547 <listitem><para>Filter output by message priorities or
548 priority ranges. Takes either a single numeric or textual log
549 level (i.e. between
0/
<literal>emerg
</literal> and
550 7/
<literal>debug
</literal>), or a range of numeric/text log
551 levels in the form FROM..TO. The log levels are the usual
552 syslog log levels as documented in
553 <citerefentry project='man-pages'
><refentrytitle>syslog
</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
554 i.e.
<literal>emerg
</literal> (
0),
555 <literal>alert
</literal> (
1),
<literal>crit
</literal> (
2),
556 <literal>err
</literal> (
3),
<literal>warning
</literal> (
4),
557 <literal>notice
</literal> (
5),
<literal>info
</literal> (
6),
558 <literal>debug
</literal> (
7). If a single log level is
559 specified, all messages with this log level or a lower (hence
560 more important) log level are shown. If a range is specified,
561 all messages within the range are shown, including both the
562 start and the end value of the range. This will add
563 <literal>PRIORITY=
</literal> matches for the specified
564 priorities.
</para></listitem>
568 <term><option>-g
</option></term>
569 <term><option>--grep=
</option></term>
571 <listitem><para>Filter output to entries where the
<varname>MESSAGE=
</varname>
572 field matches the specified regular expression. PERL-compatible regular expressions
574 <citerefentry><refentrytitle>pcre2pattern
</refentrytitle><manvolnum>3</manvolnum></citerefentry>
575 for a detailed description of the syntax.
</para>
577 <para>If the pattern is all lowercase, matching is case insensitive.
578 Otherwise, matching is case sensitive. This can be overridden with the
579 <option>--case-sensitive
</option> option, see below.
</para>
584 <term><option>--case-sensitive
<optional>=BOOLEAN
</optional></option></term>
586 <listitem><para>Make pattern matching case sensitive or case insenstive.
</para>
591 <term><option>-c
</option></term>
592 <term><option>--cursor=
</option></term>
594 <listitem><para>Start showing entries from the location in the
595 journal specified by the passed cursor.
</para></listitem>
599 <term><option>--after-cursor=
</option></term>
601 <listitem><para>Start showing entries from the location in the
602 journal
<emphasis>after
</emphasis> the location specified by
603 the passed cursor. The cursor is shown when the
604 <option>--show-cursor
</option> option is used.
</para>
609 <term><option>--show-cursor
</option></term>
611 <listitem><para>The cursor is shown after the last entry after
613 <programlisting>-- cursor: s=
0639…
</programlisting>
614 <para>The format of the cursor is private
615 and subject to change.
</para></listitem>
619 <term><option>-S
</option></term>
620 <term><option>--since=
</option></term>
621 <term><option>-U
</option></term>
622 <term><option>--until=
</option></term>
624 <listitem><para>Start showing entries on or newer than the specified date, or on or older than the specified
625 date, respectively. Date specifications should be of the format
<literal>2012-
10-
30 18:
17:
16</literal>. If the
626 time part is omitted,
<literal>00:
00:
00</literal> is assumed. If only the seconds component is omitted,
627 <literal>:
00</literal> is assumed. If the date component is omitted, the current day is assumed. Alternatively
628 the strings
<literal>yesterday
</literal>,
<literal>today
</literal>,
<literal>tomorrow
</literal> are understood,
629 which refer to
00:
00:
00 of the day before the current day, the current day, or the day after the current day,
630 respectively.
<literal>now
</literal> refers to the current time. Finally, relative times may be specified,
631 prefixed with
<literal>-
</literal> or
<literal>+
</literal>, referring to times before or after the current
632 time, respectively. For complete time and date specification, see
633 <citerefentry><refentrytitle>systemd.time
</refentrytitle><manvolnum>7</manvolnum></citerefentry>. Note that
634 <option>--output=short-full
</option> prints timestamps that follow precisely this format.
640 <term><option>-F
</option></term>
641 <term><option>--field=
</option></term>
643 <listitem><para>Print all possible data values the specified
644 field can take in all entries of the journal.
</para></listitem>
648 <term><option>-N
</option></term>
649 <term><option>--fields
</option></term>
651 <listitem><para>Print all field names currently used in all entries of the journal.
</para></listitem>
655 <term><option>--system
</option></term>
656 <term><option>--user
</option></term>
658 <listitem><para>Show messages from system services and the
659 kernel (with
<option>--system
</option>). Show messages from
660 service of current user (with
<option>--user
</option>). If
661 neither is specified, show all messages that the user can see.
666 <term><option>-M
</option></term>
667 <term><option>--machine=
</option></term>
669 <listitem><para>Show messages from a running, local
670 container. Specify a container name to connect to.
</para>
675 <term><option>-D
<replaceable>DIR
</replaceable></option></term>
676 <term><option>--directory=
<replaceable>DIR
</replaceable></option></term>
678 <listitem><para>Takes a directory path as argument. If
679 specified, journalctl will operate on the specified journal
680 directory
<replaceable>DIR
</replaceable> instead of the
681 default runtime and system journal paths.
</para></listitem>
685 <term><option>--file=
<replaceable>GLOB
</replaceable></option></term>
687 <listitem><para>Takes a file glob as an argument. If
688 specified, journalctl will operate on the specified journal
689 files matching
<replaceable>GLOB
</replaceable> instead of the
690 default runtime and system journal paths. May be specified
691 multiple times, in which case files will be suitably
692 interleaved.
</para></listitem>
696 <term><option>--root=
<replaceable>ROOT
</replaceable></option></term>
698 <listitem><para>Takes a directory path as an argument. If
699 specified, journalctl will operate on journal directories and catalog file hierarchy
700 underneath the specified directory instead of the root
701 directory (e.g.
<option>--update-catalog
</option> will create
702 <filename><replaceable>ROOT
</replaceable>/var/lib/systemd/catalog/database
</filename>,
703 and journal files under
<filename><replaceable>ROOT
</replaceable>/run/journal
</filename>
704 or
<filename><replaceable>ROOT
</replaceable>/var/log/journal
</filename> will be displayed).
709 <term><option>--new-id128
</option></term>
711 <listitem><para>Instead of showing journal contents, generate
712 a new
128-bit ID suitable for identifying messages. This is
713 intended for usage by developers who need a new identifier for
714 a new message they introduce and want to make
715 recognizable. This will print the new ID in four different
716 formats which can be copied into source code or similar.
721 <term><option>--header
</option></term>
723 <listitem><para>Instead of showing journal contents, show
724 internal header information of the journal fields
725 accessed.
</para></listitem>
729 <term><option>--disk-usage
</option></term>
731 <listitem><para>Shows the current disk usage of all journal
732 files. This shows the sum of the disk usage of all archived
733 and active journal files.
</para></listitem>
737 <term><option>--vacuum-size=
</option></term>
738 <term><option>--vacuum-time=
</option></term>
739 <term><option>--vacuum-files=
</option></term>
741 <listitem><para>Removes the oldest archived journal files until the disk
742 space they use falls below the specified size (specified with
743 the usual
<literal>K
</literal>,
<literal>M
</literal>,
744 <literal>G
</literal> and
<literal>T
</literal> suffixes), or all
745 archived journal files contain no data older than the specified
746 timespan (specified with the usual
<literal>s
</literal>,
747 <literal>m
</literal>,
<literal>h
</literal>,
748 <literal>days
</literal>,
<literal>months
</literal>,
749 <literal>weeks
</literal> and
<literal>years
</literal> suffixes),
750 or no more than the specified number of separate journal files
751 remain. Note that running
<option>--vacuum-size=
</option> has
752 only an indirect effect on the output shown by
753 <option>--disk-usage
</option>, as the latter includes active
754 journal files, while the vacuuming operation only operates
755 on archived journal files. Similarly,
756 <option>--vacuum-files=
</option> might not actually reduce the
757 number of journal files to below the specified number, as it
758 will not remove active journal
759 files.
<option>--vacuum-size=
</option>,
760 <option>--vacuum-time=
</option> and
761 <option>--vacuum-files=
</option> may be combined in a single
762 invocation to enforce any combination of a size, a time and a
763 number of files limit on the archived journal
764 files. Specifying any of these three parameters as zero is
765 equivalent to not enforcing the specific limit, and is thus
766 redundant.
</para></listitem>
770 <term><option>--list-catalog
771 <optional><replaceable>128-bit-ID…
</replaceable></optional>
774 <listitem><para>List the contents of the message catalog as a
775 table of message IDs, plus their short description strings.
778 <para>If any
<replaceable>128-bit-ID
</replaceable>s are
779 specified, only those entries are shown.
</para>
784 <term><option>--dump-catalog
785 <optional><replaceable>128-bit-ID…
</replaceable></optional>
788 <listitem><para>Show the contents of the message catalog, with
789 entries separated by a line consisting of two dashes and the
790 ID (the format is the same as
<filename>.catalog
</filename>
793 <para>If any
<replaceable>128-bit-ID
</replaceable>s are
794 specified, only those entries are shown.
</para>
799 <term><option>--update-catalog
</option></term>
801 <listitem><para>Update the message catalog index. This command
802 needs to be executed each time new catalog files are
803 installed, removed, or updated to rebuild the binary catalog
804 index.
</para></listitem>
808 <term><option>--setup-keys
</option></term>
810 <listitem><para>Instead of showing journal contents, generate
811 a new key pair for Forward Secure Sealing (FSS). This will
812 generate a sealing key and a verification key. The sealing key
813 is stored in the journal data directory and shall remain on
814 the host. The verification key should be stored
815 externally. Refer to the
<option>Seal=
</option> option in
816 <citerefentry><refentrytitle>journald.conf
</refentrytitle><manvolnum>5</manvolnum></citerefentry>
817 for information on Forward Secure Sealing and for a link to a
818 refereed scholarly paper detailing the cryptographic theory it
819 is based on.
</para></listitem>
823 <term><option>--force
</option></term>
825 <listitem><para>When
<option>--setup-keys
</option> is passed
826 and Forward Secure Sealing (FSS) has already been configured,
827 recreate FSS keys.
</para></listitem>
831 <term><option>--interval=
</option></term>
833 <listitem><para>Specifies the change interval for the sealing
834 key when generating an FSS key pair with
835 <option>--setup-keys
</option>. Shorter intervals increase CPU
836 consumption but shorten the time range of undetectable journal
837 alterations. Defaults to
15min.
</para></listitem>
841 <term><option>--verify
</option></term>
843 <listitem><para>Check the journal file for internal
844 consistency. If the file has been generated with FSS enabled and
845 the FSS verification key has been specified with
846 <option>--verify-key=
</option>, authenticity of the journal file
847 is verified.
</para></listitem>
851 <term><option>--verify-key=
</option></term>
853 <listitem><para>Specifies the FSS verification key to use for
854 the
<option>--verify
</option> operation.
</para></listitem>
858 <term><option>--sync
</option></term>
860 <listitem><para>Asks the journal daemon to write all yet
861 unwritten journal data to the backing file system and
862 synchronize all journals. This call does not return until the
863 synchronization operation is complete. This command guarantees
864 that any log messages written before its invocation are safely
865 stored on disk at the time it returns.
</para></listitem>
869 <term><option>--flush
</option></term>
871 <listitem><para>Asks the journal daemon to flush any log data
872 stored in
<filename>/run/log/journal
</filename> into
873 <filename>/var/log/journal
</filename>, if persistent storage
874 is enabled. This call does not return until the operation is
875 complete. Note that this call is idempotent: the data is only
876 flushed from
<filename>/run/log/journal
</filename> into
877 <filename>/var/log/journal
</filename> once during system
878 runtime, and this command exits cleanly without executing any
879 operation if this has already happened. This command
880 effectively guarantees that all data is flushed to
881 <filename>/var/log/journal
</filename> at the time it
882 returns.
</para></listitem>
886 <term><option>--rotate
</option></term>
888 <listitem><para>Asks the journal daemon to rotate journal
889 files. This call does not return until the rotation operation
890 is complete.
</para></listitem>
893 <xi:include href=
"standard-options.xml" xpointer=
"help" />
894 <xi:include href=
"standard-options.xml" xpointer=
"version" />
895 <xi:include href=
"standard-options.xml" xpointer=
"no-pager" />
900 <title>Exit status
</title>
902 <para>On success,
0 is returned; otherwise, a non-zero failure
903 code is returned.
</para>
906 <xi:include href=
"less-variables.xml" />
909 <title>Examples
</title>
911 <para>Without arguments, all collected logs are shown
914 <programlisting>journalctl
</programlisting>
916 <para>With one match specified, all entries with a field matching
917 the expression are shown:
</para>
919 <programlisting>journalctl _SYSTEMD_UNIT=avahi-daemon.service
920 journalctl _SYSTEMD_CGROUP=/user.slice/user-
42.slice/session-c1.scope
</programlisting>
922 <para>If two different fields are matched, only entries matching
923 both expressions at the same time are shown:
</para>
925 <programlisting>journalctl _SYSTEMD_UNIT=avahi-daemon.service _PID=
28097</programlisting>
927 <para>If two matches refer to the same field, all entries matching
928 either expression are shown:
</para>
930 <programlisting>journalctl _SYSTEMD_UNIT=avahi-daemon.service _SYSTEMD_UNIT=dbus.service
</programlisting>
932 <para>If the separator
<literal>+
</literal> is used, two
933 expressions may be combined in a logical OR. The following will
934 show all messages from the Avahi service process with the PID
935 28097 plus all messages from the D-Bus service (from any of its
938 <programlisting>journalctl _SYSTEMD_UNIT=avahi-daemon.service _PID=
28097 + _SYSTEMD_UNIT=dbus.service
</programlisting>
940 <para>To show all fields emitted
<emphasis>by
</emphasis> a unit and
<emphasis>about
</emphasis>
941 the unit, option
<option>-u
</option>/
<option>--unit=
</option> should be used.
942 <command>journalctl -u
<replaceable>name
</replaceable></command>
943 expands to a complex filter similar to
944 <programlisting>_SYSTEMD_UNIT=
<replaceable>name
</replaceable>.service
945 + UNIT=
<replaceable>name
</replaceable>.service _PID=
1
946 + OBJECT_SYSTEMD_UNIT=
<replaceable>name
</replaceable>.service _UID=
0
947 + COREDUMP_UNIT=
<replaceable>name
</replaceable>.service _UID=
0 MESSAGE_ID=fc2e22bc6ee647b6b90729ab34a250b1
949 (see
<citerefentry><refentrytitle>systemd.journal-fields
</refentrytitle><manvolnum>5</manvolnum></citerefentry>
950 for an explanation of those patterns).
953 <para>Show all logs generated by the D-Bus executable:
</para>
955 <programlisting>journalctl /usr/bin/dbus-daemon
</programlisting>
957 <para>Show all kernel logs from previous boot:
</para>
959 <programlisting>journalctl -k -b -
1</programlisting>
961 <para>Show a live log display from a system service
962 <filename>apache.service
</filename>:
</para>
964 <programlisting>journalctl -f -u apache
</programlisting>
969 <title>See Also
</title>
971 <citerefentry><refentrytitle>systemd
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
972 <citerefentry><refentrytitle>systemd-journald.service
</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
973 <citerefentry><refentrytitle>systemctl
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
974 <citerefentry><refentrytitle>coredumpctl
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
975 <citerefentry><refentrytitle>systemd.journal-fields
</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
976 <citerefentry><refentrytitle>journald.conf
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
977 <citerefentry><refentrytitle>systemd.time
</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
978 <citerefentry><refentrytitle>systemd-journal-remote.service
</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
979 <citerefentry><refentrytitle>systemd-journal-upload.service
</refentrytitle><manvolnum>8</manvolnum></citerefentry>