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