]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/journalctl.xml
journalctl: add --no-hostname switch
[thirdparty/systemd.git] / man / journalctl.xml
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">
4
5 <!--
6 This file is part of systemd.
7
8 Copyright 2012 Lennart Poettering
9
10 systemd is free software; you can redistribute it and/or modify it
11 under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation; either version 2.1 of the License, or
13 (at your option) any later version.
14
15 systemd is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Lesser General Public License for more details.
19
20 You should have received a copy of the GNU Lesser General Public License
21 along with systemd; If not, see <http://www.gnu.org/licenses/>.
22 -->
23
24 <refentry id="journalctl"
25 xmlns:xi="http://www.w3.org/2001/XInclude">
26
27 <refentryinfo>
28 <title>journalctl</title>
29 <productname>systemd</productname>
30
31 <authorgroup>
32 <author>
33 <contrib>Developer</contrib>
34 <firstname>Lennart</firstname>
35 <surname>Poettering</surname>
36 <email>lennart@poettering.net</email>
37 </author>
38 </authorgroup>
39 </refentryinfo>
40
41 <refmeta>
42 <refentrytitle>journalctl</refentrytitle>
43 <manvolnum>1</manvolnum>
44 </refmeta>
45
46 <refnamediv>
47 <refname>journalctl</refname>
48 <refpurpose>Query the systemd journal</refpurpose>
49 </refnamediv>
50
51 <refsynopsisdiv>
52 <cmdsynopsis>
53 <command>journalctl</command>
54 <arg choice="opt" rep="repeat">OPTIONS</arg>
55 <arg choice="opt" rep="repeat">MATCHES</arg>
56 </cmdsynopsis>
57 </refsynopsisdiv>
58
59 <refsect1>
60 <title>Description</title>
61
62 <para><command>journalctl</command> may be used to query the
63 contents of the
64 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>
65 journal as written by
66 <citerefentry><refentrytitle>systemd-journald.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
67
68 <para>If called without parameters, it will show the full
69 contents of the journal, starting with the oldest entry
70 collected.</para>
71
72 <para>If one or more match arguments are passed, the output is
73 filtered accordingly. A match is in the format
74 <literal>FIELD=VALUE</literal>,
75 e.g. <literal>_SYSTEMD_UNIT=httpd.service</literal>, referring
76 to the components of a structured journal entry. See
77 <citerefentry><refentrytitle>systemd.journal-fields</refentrytitle><manvolnum>7</manvolnum></citerefentry>
78 for a list of well-known fields. If multiple matches are
79 specified matching different fields, the log entries are
80 filtered by both, i.e. the resulting output will show only
81 entries matching all the specified matches of this kind. If two
82 matches apply to the same field, then they are automatically
83 matched as alternatives, i.e. the resulting output will show
84 entries matching any of the specified matches for the same
85 field. Finally, the character <literal>+</literal> may appear
86 as a separate word between other terms on the command line. This
87 causes all matches before and after to be combined in a
88 disjunction (i.e. logical OR).</para>
89
90 <para>As shortcuts for a few types of field/value matches, file
91 paths may be specified. If a file path refers to an executable
92 file, this is equivalent to an <literal>_EXE=</literal> match
93 for the canonicalized binary path. Similarly, if a path refers
94 to a device node then match is added for the kernel name of the
95 device (<literal>_KERNEL_DEVICE=</literal>). Also, matches for the
96 kernel names of all the parent devices are added automatically.
97 Device node paths are not stable across reboots, therefore match
98 for the current boot id (<literal>_BOOT_ID=</literal>) is
99 always added as well. Note that only the log entries for
100 the existing device nodes maybe queried by providing path to
101 the device node.</para>
102
103 <para>Additional constraints may be added using options
104 <option>--boot</option>, <option>--unit=</option>, etc., to
105 further limit what entries will be shown (logical AND).</para>
106
107 <para>Output is interleaved from all accessible journal files,
108 whether they are rotated or currently being written, and
109 regardless of whether they belong to the system itself or are
110 accessible user journals.</para>
111
112 <para>The set of journal files which will be used can be
113 modified using the <option>--user</option>,
114 <option>--system</option>, <option>--directory</option>, and
115 <option>--file</option> options, see below.</para>
116
117 <para>All users are granted access to their private per-user
118 journals. However, by default, only root and users who are
119 members of a few special groups are granted access to the system
120 journal and the journals of other users. Members of the groups
121 <literal>systemd-journal</literal>, <literal>adm</literal>, and
122 <literal>wheel</literal> can read all journal files. Note
123 that the two latter groups traditionally have additional
124 privileges specified by the distribution. Members of the
125 <literal>wheel</literal> group can often perform administrative
126 tasks.</para>
127
128 <para>The output is paged through <command>less</command> by
129 default, and long lines are "truncated" to screen width. The
130 hidden part can be viewed by using the left-arrow and
131 right-arrow keys. Paging can be disabled; see the
132 <option>--no-pager</option> option and the "Environment" section
133 below.</para>
134
135 <para>When outputting to a tty, lines are colored according to
136 priority: lines of level ERROR and higher are colored red; lines
137 of level NOTICE and higher are highlighted; other lines are
138 displayed normally.</para>
139 </refsect1>
140
141 <refsect1>
142 <title>Options</title>
143
144 <para>The following options are understood:</para>
145
146 <variablelist>
147 <varlistentry>
148 <term><option>--no-full</option></term>
149 <term><option>--full</option></term>
150 <term><option>-l</option></term>
151
152 <listitem><para>Ellipsize fields when they do not fit in
153 available columns. The default is to show full fields,
154 allowing them to wrap or be truncated by the pager, if one
155 is used.</para>
156
157 <para>The old options
158 <option>-l</option>/<option>--full</option> are not useful
159 anymore, except to undo <option>--no-full</option>.</para>
160 </listitem>
161 </varlistentry>
162
163 <varlistentry>
164 <term><option>-a</option></term>
165 <term><option>--all</option></term>
166
167 <listitem><para>Show all fields in full, even if they
168 include unprintable characters or are very
169 long.</para></listitem>
170 </varlistentry>
171
172 <varlistentry>
173 <term><option>-f</option></term>
174 <term><option>--follow</option></term>
175
176 <listitem><para>Show only the most recent journal entries,
177 and continuously print new entries as they are appended to
178 the journal.</para></listitem>
179 </varlistentry>
180
181 <varlistentry>
182 <term><option>-e</option></term>
183 <term><option>--pager-end</option></term>
184
185 <listitem><para>Immediately jump to the end of the journal
186 inside the implied pager tool. This implies
187 <option>-n1000</option> to guarantee that the pager will not
188 buffer logs of unbounded size. This may be overridden with
189 an explicit <option>-n</option> with some other numeric
190 value, while <option>-nall</option> will disable this cap.
191 Note that this option is only supported for the
192 <citerefentry project='man-pages'><refentrytitle>less</refentrytitle><manvolnum>1</manvolnum></citerefentry>
193 pager.</para></listitem>
194 </varlistentry>
195
196 <varlistentry>
197 <term><option>-n</option></term>
198 <term><option>--lines=</option></term>
199
200 <listitem><para>Show the most recent journal events and
201 limit the number of events shown. If
202 <option>--follow</option> is used, this option is
203 implied. The argument is a positive integer or
204 <literal>all</literal> to disable line limiting. The default
205 value is 10 if no argument is given.</para></listitem>
206 </varlistentry>
207
208 <varlistentry>
209 <term><option>--no-tail</option></term>
210
211 <listitem><para>Show all stored output lines, even in follow
212 mode. Undoes the effect of <option>--lines=</option>.
213 </para></listitem>
214 </varlistentry>
215
216 <varlistentry>
217 <term><option>-r</option></term>
218 <term><option>--reverse</option></term>
219
220 <listitem><para>Reverse output so that the newest entries
221 are displayed first.</para></listitem>
222 </varlistentry>
223
224 <varlistentry>
225 <term><option>-o</option></term>
226 <term><option>--output=</option></term>
227
228 <listitem><para>Controls the formatting of the journal
229 entries that are shown. Takes one of the following
230 options:</para>
231 <variablelist>
232 <varlistentry>
233 <term>
234 <option>short</option>
235 </term>
236 <listitem>
237 <para>is the default and generates an output that is
238 mostly identical to the formatting of classic syslog
239 files, showing one line per journal entry.</para>
240 </listitem>
241 </varlistentry>
242
243 <varlistentry>
244 <term>
245 <option>short-iso</option>
246 </term>
247 <listitem>
248 <para>is very similar, but shows ISO 8601 wallclock
249 timestamps.</para>
250 </listitem>
251 </varlistentry>
252
253 <varlistentry>
254 <term>
255 <option>short-precise</option>
256 </term>
257 <listitem>
258 <para>is very similar, but shows timestamps with full
259 microsecond precision.</para>
260 </listitem>
261 </varlistentry>
262
263 <varlistentry>
264 <term>
265 <option>short-monotonic</option>
266 </term>
267 <listitem>
268 <para>is very similar, but shows monotonic timestamps
269 instead of wallclock timestamps.</para>
270 </listitem>
271 </varlistentry>
272
273 <varlistentry>
274 <term>
275 <option>short-unix</option>
276 </term>
277 <listitem>
278 <para>is very similar, but shows seconds passed since January 1st 1970 UTC instead of wallclock
279 timestamps ("UNIX time"). The time is shown with microsecond accuracy.</para>
280 </listitem>
281 </varlistentry>
282
283 <varlistentry>
284 <term>
285 <option>verbose</option>
286 </term>
287 <listitem>
288 <para>shows the full-structured entry items with all
289 fields.</para>
290 </listitem>
291 </varlistentry>
292
293 <varlistentry>
294 <term>
295 <option>export</option>
296 </term>
297 <listitem>
298 <para>serializes the journal into a binary (but mostly
299 text-based) stream suitable for backups and network
300 transfer (see
301 <ulink url="http://www.freedesktop.org/wiki/Software/systemd/export">Journal Export Format</ulink>
302 for more information).</para>
303 </listitem>
304 </varlistentry>
305
306 <varlistentry>
307 <term>
308 <option>json</option>
309 </term>
310 <listitem>
311 <para>formats entries as JSON data structures, one per
312 line (see
313 <ulink url="http://www.freedesktop.org/wiki/Software/systemd/json">Journal JSON Format</ulink>
314 for more information).</para>
315 </listitem>
316 </varlistentry>
317
318 <varlistentry>
319 <term>
320 <option>json-pretty</option>
321 </term>
322 <listitem>
323 <para>formats entries as JSON data structures, but
324 formats them in multiple lines in order to make them
325 more readable by humans.</para>
326 </listitem>
327 </varlistentry>
328
329 <varlistentry>
330 <term>
331 <option>json-sse</option>
332 </term>
333 <listitem>
334 <para>formats entries as JSON data structures, but wraps
335 them in a format suitable for
336 <ulink url="https://developer.mozilla.org/en-US/docs/Server-sent_events/Using_server-sent_events">Server-Sent Events</ulink>.
337 </para>
338 </listitem>
339 </varlistentry>
340
341 <varlistentry>
342 <term>
343 <option>cat</option>
344 </term>
345 <listitem>
346 <para>generates a very terse output, only showing the
347 actual message of each journal entry with no metadata,
348 not even a timestamp.</para>
349 </listitem>
350 </varlistentry>
351 </variablelist>
352 </listitem>
353 </varlistentry>
354
355 <varlistentry>
356 <term><option>--utc</option></term>
357
358 <listitem><para>Express time in Coordinated Universal Time
359 (UTC).</para></listitem>
360 </varlistentry>
361
362 <varlistentry>
363 <term><option>--no-hostname</option></term>
364
365 <listitem><para>Don't show the hostname field of log messages originating from the local host. This switch only
366 has an effect on the <option>short</option> family of output modes (see above).</para></listitem>
367 </varlistentry>
368
369 <varlistentry>
370 <term><option>-x</option></term>
371 <term><option>--catalog</option></term>
372
373 <listitem><para>Augment log lines with explanation texts from
374 the message catalog. This will add explanatory help texts to
375 log messages in the output where this is available. These
376 short help texts will explain the context of an error or log
377 event, possible solutions, as well as pointers to support
378 forums, developer documentation, and any other relevant
379 manuals. Note that help texts are not available for all
380 messages, but only for selected ones. For more information on
381 the message catalog, please refer to the
382 <ulink url="http://www.freedesktop.org/wiki/Software/systemd/catalog">Message Catalog Developer Documentation</ulink>.</para>
383
384 <para>Note: when attaching <command>journalctl</command>
385 output to bug reports, please do <emphasis>not</emphasis> use
386 <option>-x</option>.</para>
387 </listitem>
388 </varlistentry>
389
390 <varlistentry>
391 <term><option>-q</option></term>
392 <term><option>--quiet</option></term>
393
394 <listitem><para>Suppresses all info messages
395 (i.e. "-- Logs begin at ...", "-- Reboot --"),
396 any warning messages regarding
397 inaccessible system journals when run as a normal
398 user.</para></listitem>
399 </varlistentry>
400
401 <varlistentry>
402 <term><option>-m</option></term>
403 <term><option>--merge</option></term>
404
405 <listitem><para>Show entries interleaved from all available
406 journals, including remote ones.</para></listitem>
407 </varlistentry>
408
409 <varlistentry>
410 <term><option>-b <optional><replaceable>ID</replaceable></optional><optional><replaceable>±offset</replaceable></optional></option></term>
411 <term><option>--boot=<optional><replaceable>ID</replaceable></optional><optional><replaceable>±offset</replaceable></optional></option></term>
412
413 <listitem><para>Show messages from a specific boot. This will
414 add a match for <literal>_BOOT_ID=</literal>.</para>
415
416 <para>The argument may be empty, in which case logs for the
417 current boot will be shown.</para>
418
419 <para>If the boot ID is omitted, a positive
420 <replaceable>offset</replaceable> will look up the boots
421 starting from the beginning of the journal, and an
422 equal-or-less-than zero <replaceable>offset</replaceable> will
423 look up boots starting from the end of the journal. Thus,
424 <constant>1</constant> means the first boot found in the
425 journal in chronological order, <constant>2</constant> the
426 second and so on; while <constant>-0</constant> is the last
427 boot, <constant>-1</constant> the boot before last, and so
428 on. An empty <replaceable>offset</replaceable> is equivalent
429 to specifying <constant>-0</constant>, except when the current
430 boot is not the last boot (e.g. because
431 <option>--directory</option> was specified to look at logs
432 from a different machine).</para>
433
434 <para>If the 32-character <replaceable>ID</replaceable> is
435 specified, it may optionally be followed by
436 <replaceable>offset</replaceable> which identifies the boot
437 relative to the one given by boot
438 <replaceable>ID</replaceable>. Negative values mean earlier
439 boots and positive values mean later boots. If
440 <replaceable>offset</replaceable> is not specified, a value of
441 zero is assumed, and the logs for the boot given by
442 <replaceable>ID</replaceable> are shown.</para>
443 </listitem>
444 </varlistentry>
445
446 <varlistentry>
447 <term><option>--list-boots</option></term>
448
449 <listitem><para>Show a tabular list of boot numbers (relative to
450 the current boot), their IDs, and the timestamps of the first
451 and last message pertaining to the boot.</para></listitem>
452 </varlistentry>
453
454 <varlistentry>
455 <term><option>-k</option></term>
456 <term><option>--dmesg</option></term>
457
458 <listitem><para>Show only kernel messages. This implies
459 <option>-b</option> and adds the match
460 <literal>_TRANSPORT=kernel</literal>.</para></listitem>
461 </varlistentry>
462
463 <varlistentry>
464 <term><option>-t</option></term>
465 <term><option>--identifier=<replaceable>SYSLOG_IDENTIFIER</replaceable></option></term>
466
467 <listitem><para>Show messages for the specified syslog
468 identifier
469 <replaceable>SYSLOG_IDENTIFIER</replaceable>.</para>
470
471 <para>This parameter can be specified multiple
472 times.</para></listitem>
473 </varlistentry>
474
475 <varlistentry>
476 <term><option>-u</option></term>
477 <term><option>--unit=<replaceable>UNIT</replaceable>|<replaceable>PATTERN</replaceable></option></term>
478
479 <listitem><para>Show messages for the specified systemd unit
480 <replaceable>UNIT</replaceable> (such as a service unit), or
481 for any of the units matched by
482 <replaceable>PATTERN</replaceable>. If a pattern is
483 specified, a list of unit names found in the journal is
484 compared with the specified pattern and all that match are
485 used. For each unit name, a match is added for messages from
486 the unit
487 (<literal>_SYSTEMD_UNIT=<replaceable>UNIT</replaceable></literal>),
488 along with additional matches for messages from systemd and
489 messages about coredumps for the specified unit.</para>
490
491 <para>This parameter can be specified multiple times.</para>
492 </listitem>
493 </varlistentry>
494
495 <varlistentry>
496 <term><option>--user-unit=</option></term>
497
498 <listitem><para>Show messages for the specified user session
499 unit. This will add a match for messages from the unit
500 (<literal>_SYSTEMD_USER_UNIT=</literal> and
501 <literal>_UID=</literal>) and additional matches for messages
502 from session systemd and messages about coredumps for the
503 specified unit.</para>
504
505 <para>This parameter can be specified multiple times.</para>
506 </listitem>
507 </varlistentry>
508
509 <varlistentry>
510 <term><option>-p</option></term>
511 <term><option>--priority=</option></term>
512
513 <listitem><para>Filter output by message priorities or
514 priority ranges. Takes either a single numeric or textual log
515 level (i.e. between 0/<literal>emerg</literal> and
516 7/<literal>debug</literal>), or a range of numeric/text log
517 levels in the form FROM..TO. The log levels are the usual
518 syslog log levels as documented in
519 <citerefentry project='man-pages'><refentrytitle>syslog</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
520 i.e. <literal>emerg</literal> (0),
521 <literal>alert</literal> (1), <literal>crit</literal> (2),
522 <literal>err</literal> (3), <literal>warning</literal> (4),
523 <literal>notice</literal> (5), <literal>info</literal> (6),
524 <literal>debug</literal> (7). If a single log level is
525 specified, all messages with this log level or a lower (hence
526 more important) log level are shown. If a range is specified,
527 all messages within the range are shown, including both the
528 start and the end value of the range. This will add
529 <literal>PRIORITY=</literal> matches for the specified
530 priorities.</para></listitem>
531 </varlistentry>
532
533 <varlistentry>
534 <term><option>-c</option></term>
535 <term><option>--cursor=</option></term>
536
537 <listitem><para>Start showing entries from the location in the
538 journal specified by the passed cursor.</para></listitem>
539 </varlistentry>
540
541 <varlistentry>
542 <term><option>--after-cursor=</option></term>
543
544 <listitem><para>Start showing entries from the location in the
545 journal <emphasis>after</emphasis> the location specified by
546 the passed cursor. The cursor is shown when the
547 <option>--show-cursor</option> option is used.</para>
548 </listitem>
549 </varlistentry>
550
551 <varlistentry>
552 <term><option>--show-cursor</option></term>
553
554 <listitem><para>The cursor is shown after the last entry after
555 two dashes:</para>
556 <programlisting>-- cursor: s=0639...</programlisting>
557 <para>The format of the cursor is private
558 and subject to change.</para></listitem>
559 </varlistentry>
560
561 <varlistentry>
562 <term><option>-S</option></term>
563 <term><option>--since=</option></term>
564 <term><option>-U</option></term>
565 <term><option>--until=</option></term>
566
567 <listitem><para>Start showing entries on or newer than the
568 specified date, or on or older than the specified date,
569 respectively. Date specifications should be of the format
570 <literal>2012-10-30 18:17:16</literal>. If the time part is
571 omitted, <literal>00:00:00</literal> is assumed. If only the
572 seconds component is omitted, <literal>:00</literal> is
573 assumed. If the date component is omitted, the current day is
574 assumed. Alternatively the strings
575 <literal>yesterday</literal>, <literal>today</literal>,
576 <literal>tomorrow</literal> are understood, which refer to
577 00:00:00 of the day before the current day, the current day,
578 or the day after the current day,
579 respectively. <literal>now</literal> refers to the current
580 time. Finally, relative times may be specified, prefixed with
581 <literal>-</literal> or <literal>+</literal>, referring to
582 times before or after the current time, respectively. For complete
583 time and date specification, see
584 <citerefentry><refentrytitle>systemd.time</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
585 </para>
586 </listitem>
587 </varlistentry>
588
589 <varlistentry>
590 <term><option>-F</option></term>
591 <term><option>--field=</option></term>
592
593 <listitem><para>Print all possible data values the specified
594 field can take in all entries of the journal.</para></listitem>
595 </varlistentry>
596
597 <varlistentry>
598 <term><option>-N</option></term>
599 <term><option>--fields</option></term>
600
601 <listitem><para>Print all field names currently used in all entries of the journal.</para></listitem>
602 </varlistentry>
603
604 <varlistentry>
605 <term><option>--system</option></term>
606 <term><option>--user</option></term>
607
608 <listitem><para>Show messages from system services and the
609 kernel (with <option>--system</option>). Show messages from
610 service of current user (with <option>--user</option>). If
611 neither is specified, show all messages that the user can see.
612 </para></listitem>
613 </varlistentry>
614
615 <varlistentry>
616 <term><option>-M</option></term>
617 <term><option>--machine=</option></term>
618
619 <listitem><para>Show messages from a running, local
620 container. Specify a container name to connect to.</para>
621 </listitem>
622 </varlistentry>
623
624 <varlistentry>
625 <term><option>-D <replaceable>DIR</replaceable></option></term>
626 <term><option>--directory=<replaceable>DIR</replaceable></option></term>
627
628 <listitem><para>Takes a directory path as argument. If
629 specified, journalctl will operate on the specified journal
630 directory <replaceable>DIR</replaceable> instead of the
631 default runtime and system journal paths.</para></listitem>
632 </varlistentry>
633
634 <varlistentry>
635 <term><option>--file=<replaceable>GLOB</replaceable></option></term>
636
637 <listitem><para>Takes a file glob as an argument. If
638 specified, journalctl will operate on the specified journal
639 files matching <replaceable>GLOB</replaceable> instead of the
640 default runtime and system journal paths. May be specified
641 multiple times, in which case files will be suitably
642 interleaved.</para></listitem>
643 </varlistentry>
644
645 <varlistentry>
646 <term><option>--root=<replaceable>ROOT</replaceable></option></term>
647
648 <listitem><para>Takes a directory path as an argument. If
649 specified, journalctl will operate on catalog file hierarchy
650 underneath the specified directory instead of the root
651 directory (e.g. <option>--update-catalog</option> will create
652 <filename><replaceable>ROOT</replaceable>/var/lib/systemd/catalog/database</filename>).
653 </para></listitem>
654 </varlistentry>
655
656 <varlistentry>
657 <term><option>--new-id128</option></term>
658
659 <listitem><para>Instead of showing journal contents, generate
660 a new 128-bit ID suitable for identifying messages. This is
661 intended for usage by developers who need a new identifier for
662 a new message they introduce and want to make
663 recognizable. This will print the new ID in three different
664 formats which can be copied into source code or similar.
665 </para></listitem>
666 </varlistentry>
667
668 <varlistentry>
669 <term><option>--header</option></term>
670
671 <listitem><para>Instead of showing journal contents, show
672 internal header information of the journal fields
673 accessed.</para></listitem>
674 </varlistentry>
675
676 <varlistentry>
677 <term><option>--disk-usage</option></term>
678
679 <listitem><para>Shows the current disk usage of all journal
680 files. This shows the sum of the disk usage of all archived
681 and active journal files.</para></listitem>
682 </varlistentry>
683
684 <varlistentry>
685 <term><option>--vacuum-size=</option></term>
686 <term><option>--vacuum-time=</option></term>
687 <term><option>--vacuum-files=</option></term>
688
689 <listitem><para>Removes archived journal files until the disk
690 space they use falls below the specified size (specified with
691 the usual <literal>K</literal>, <literal>M</literal>,
692 <literal>G</literal> and <literal>T</literal> suffixes), or all
693 archived journal files contain no data older than the specified
694 timespan (specified with the usual <literal>s</literal>,
695 <literal>m</literal>, <literal>h</literal>,
696 <literal>days</literal>, <literal>months</literal>,
697 <literal>weeks</literal> and <literal>years</literal> suffixes),
698 or no more than the specified number of separate journal files
699 remain. Note that running <option>--vacuum-size=</option> has
700 only an indirect effect on the output shown by
701 <option>--disk-usage</option>, as the latter includes active
702 journal files, while the vacuuming operation only operates
703 on archived journal files. Similarly,
704 <option>--vacuum-files=</option> might not actually reduce the
705 number of journal files to below the specified number, as it
706 will not remove active journal
707 files. <option>--vacuum-size=</option>,
708 <option>--vacuum-time=</option> and
709 <option>--vacuum-files=</option> may be combined in a single
710 invocation to enforce any combination of a size, a time and a
711 number of files limit on the archived journal
712 files. Specifying any of these three parameters as zero is
713 equivalent to not enforcing the specific limit, and is thus
714 redundant.</para></listitem>
715 </varlistentry>
716
717 <varlistentry>
718 <term><option>--list-catalog
719 <optional><replaceable>128-bit-ID...</replaceable></optional>
720 </option></term>
721
722 <listitem><para>List the contents of the message catalog as a
723 table of message IDs, plus their short description strings.
724 </para>
725
726 <para>If any <replaceable>128-bit-ID</replaceable>s are
727 specified, only those entries are shown.</para>
728 </listitem>
729 </varlistentry>
730
731 <varlistentry>
732 <term><option>--dump-catalog
733 <optional><replaceable>128-bit-ID...</replaceable></optional>
734 </option></term>
735
736 <listitem><para>Show the contents of the message catalog, with
737 entries separated by a line consisting of two dashes and the
738 ID (the format is the same as <filename>.catalog</filename>
739 files).</para>
740
741 <para>If any <replaceable>128-bit-ID</replaceable>s are
742 specified, only those entries are shown.</para>
743 </listitem>
744 </varlistentry>
745
746 <varlistentry>
747 <term><option>--update-catalog</option></term>
748
749 <listitem><para>Update the message catalog index. This command
750 needs to be executed each time new catalog files are
751 installed, removed, or updated to rebuild the binary catalog
752 index.</para></listitem>
753 </varlistentry>
754
755 <varlistentry>
756 <term><option>--setup-keys</option></term>
757
758 <listitem><para>Instead of showing journal contents, generate
759 a new key pair for Forward Secure Sealing (FSS). This will
760 generate a sealing key and a verification key. The sealing key
761 is stored in the journal data directory and shall remain on
762 the host. The verification key should be stored
763 externally. Refer to the <option>Seal=</option> option in
764 <citerefentry><refentrytitle>journald.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>
765 for information on Forward Secure Sealing and for a link to a
766 refereed scholarly paper detailing the cryptographic theory it
767 is based on.</para></listitem>
768 </varlistentry>
769
770 <varlistentry>
771 <term><option>--force</option></term>
772
773 <listitem><para>When <option>--setup-keys</option> is passed
774 and Forward Secure Sealing (FSS) has already been configured,
775 recreate FSS keys.</para></listitem>
776 </varlistentry>
777
778 <varlistentry>
779 <term><option>--interval=</option></term>
780
781 <listitem><para>Specifies the change interval for the sealing
782 key when generating an FSS key pair with
783 <option>--setup-keys</option>. Shorter intervals increase CPU
784 consumption but shorten the time range of undetectable journal
785 alterations. Defaults to 15min.</para></listitem>
786 </varlistentry>
787
788 <varlistentry>
789 <term><option>--verify</option></term>
790
791 <listitem><para>Check the journal file for internal
792 consistency. If the file has been generated with FSS enabled and
793 the FSS verification key has been specified with
794 <option>--verify-key=</option>, authenticity of the journal file
795 is verified.</para></listitem>
796 </varlistentry>
797
798 <varlistentry>
799 <term><option>--verify-key=</option></term>
800
801 <listitem><para>Specifies the FSS verification key to use for
802 the <option>--verify</option> operation.</para></listitem>
803 </varlistentry>
804
805 <varlistentry>
806 <term><option>--sync</option></term>
807
808 <listitem><para>Asks the journal daemon to write all yet
809 unwritten journal data to the backing file system and
810 synchronize all journals. This call does not return until the
811 synchronization operation is complete. This command guarantees
812 that any log messages written before its invocation are safely
813 stored on disk at the time it returns.</para></listitem>
814 </varlistentry>
815
816 <varlistentry>
817 <term><option>--flush</option></term>
818
819 <listitem><para>Asks the journal daemon to flush any log data
820 stored in <filename>/run/log/journal</filename> into
821 <filename>/var/log/journal</filename>, if persistent storage
822 is enabled. This call does not return until the operation is
823 complete. Note that this call is idempotent: the data is only
824 flushed from <filename>/run/log/journal</filename> into
825 <filename>/var/log/journal</filename> once during system
826 runtime, and this command exits cleanly without executing any
827 operation if this has already has happened. This command
828 effectively guarantees that all data is flushed to
829 <filename>/var/log/journal</filename> at the time it
830 returns.</para></listitem>
831 </varlistentry>
832
833 <varlistentry>
834 <term><option>--rotate</option></term>
835
836 <listitem><para>Asks the journal daemon to rotate journal
837 files. This call does not return until the rotation operation
838 is complete.</para></listitem>
839 </varlistentry>
840
841 <xi:include href="standard-options.xml" xpointer="help" />
842 <xi:include href="standard-options.xml" xpointer="version" />
843 <xi:include href="standard-options.xml" xpointer="no-pager" />
844 </variablelist>
845 </refsect1>
846
847 <refsect1>
848 <title>Exit status</title>
849
850 <para>On success, 0 is returned; otherwise, a non-zero failure
851 code is returned.</para>
852 </refsect1>
853
854 <xi:include href="less-variables.xml" />
855
856 <refsect1>
857 <title>Examples</title>
858
859 <para>Without arguments, all collected logs are shown
860 unfiltered:</para>
861
862 <programlisting>journalctl</programlisting>
863
864 <para>With one match specified, all entries with a field matching
865 the expression are shown:</para>
866
867 <programlisting>journalctl _SYSTEMD_UNIT=avahi-daemon.service</programlisting>
868
869 <para>If two different fields are matched, only entries matching
870 both expressions at the same time are shown:</para>
871
872 <programlisting>journalctl _SYSTEMD_UNIT=avahi-daemon.service _PID=28097</programlisting>
873
874 <para>If two matches refer to the same field, all entries matching
875 either expression are shown:</para>
876
877 <programlisting>journalctl _SYSTEMD_UNIT=avahi-daemon.service _SYSTEMD_UNIT=dbus.service</programlisting>
878
879 <para>If the separator <literal>+</literal> is used, two
880 expressions may be combined in a logical OR. The following will
881 show all messages from the Avahi service process with the PID
882 28097 plus all messages from the D-Bus service (from any of its
883 processes):</para>
884
885 <programlisting>journalctl _SYSTEMD_UNIT=avahi-daemon.service _PID=28097 + _SYSTEMD_UNIT=dbus.service</programlisting>
886
887 <para>Show all logs generated by the D-Bus executable:</para>
888
889 <programlisting>journalctl /usr/bin/dbus-daemon</programlisting>
890
891 <para>Show all kernel logs from previous boot:</para>
892
893 <programlisting>journalctl -k -b -1</programlisting>
894
895 <para>Show a live log display from a system service
896 <filename>apache.service</filename>:</para>
897
898 <programlisting>journalctl -f -u apache</programlisting>
899
900 </refsect1>
901
902 <refsect1>
903 <title>See Also</title>
904 <para>
905 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
906 <citerefentry><refentrytitle>systemd-journald.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
907 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
908 <citerefentry><refentrytitle>coredumpctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
909 <citerefentry><refentrytitle>systemd.journal-fields</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
910 <citerefentry><refentrytitle>journald.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
911 <citerefentry><refentrytitle>systemd.time</refentrytitle><manvolnum>7</manvolnum></citerefentry>
912 </para>
913 </refsect1>
914 </refentry>