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