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