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