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