Debian Codegraph @

upstream/debian-trixie/man1/journalctl.1

raw
1 '\" t
2 .TH "JOURNALCTL" "1" "" "systemd 257.13" "journalctl"
3 .\" -----------------------------------------------------------------
4 .\" * Define some portability stuff
5 .\" -----------------------------------------------------------------
6 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7 .\" http://bugs.debian.org/507673
8 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
9 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10 .ie \n(.g .ds Aq \(aq
11 .el .ds Aq '
12 .\" -----------------------------------------------------------------
13 .\" * set default formatting
14 .\" -----------------------------------------------------------------
15 .\" disable hyphenation
16 .nh
17 .\" disable justification (adjust text to left margin only)
18 .ad l
19 .\" -----------------------------------------------------------------
20 .\" * MAIN CONTENT STARTS HERE *
21 .\" -----------------------------------------------------------------
22 .SH "NAME"
23 journalctl \- Print log entries from the systemd journal
24 .SH "SYNOPSIS"
25 .HP \w'\fBjournalctl\fR\ 'u
26 \fBjournalctl\fR [OPTIONS...] [MATCHES...]
27 .SH "DESCRIPTION"
28 .PP
29 \fBjournalctl\fR
30 is used to print the log entries stored in the journal by
31 \fBsystemd-journald.service\fR(8)
32 and
33 \fBsystemd-journal-remote.service\fR(8)\&.
34 .PP
35 If called without parameters, it will show the contents of the journal accessible to the calling user, starting with the oldest entry collected\&.
36 .PP
37 If one or more match arguments are passed, the output is filtered accordingly\&. A match is in the format
38 "FIELD=VALUE", e\&.g\&.
39 "_SYSTEMD_UNIT=httpd\&.service", referring to the components of a structured journal entry\&. See
40 \fBsystemd.journal-fields\fR(7)
41 for a list of well\-known fields\&. If multiple matches are specified matching different fields, the log entries are filtered by both, i\&.e\&. the resulting output will show only entries matching all the specified matches of this kind\&. If two matches apply to the same field, then they are automatically matched as alternatives, i\&.e\&. the resulting output will show entries matching any of the specified matches for the same field\&. Finally, the character
42 "+"
43 may appear as a separate word between other terms on the command line\&. This causes all matches before and after to be combined in a disjunction (i\&.e\&. logical OR)\&.
44 .PP
45 It is also possible to filter the entries by specifying an absolute file path as an argument\&. The file path may be a file or a symbolic link and the file must exist at the time of the query\&. If a file path refers to an executable binary, an
46 "_EXE="
47 match for the canonicalized binary path is added to the query\&. If a file path refers to an executable script, a
48 "_COMM="
49 match for the script name is added to the query\&. If a file path refers to a device node,
50 "_KERNEL_DEVICE="
51 matches for the kernel name of the device and for each of its ancestor devices is added to the query\&. Symbolic links are dereferenced, kernel names are synthesized, and parent devices are identified from the environment at the time of the query\&. In general, a device node is the best proxy for an actual device, as log entries do not usually contain fields that identify an actual device\&. For the resulting log entries to be correct for the actual device, the relevant parts of the environment at the time the entry was logged, in particular the actual device corresponding to the device node, must have been the same as those at the time of the query\&. Because device nodes generally change their corresponding devices across reboots, specifying a device node path causes the resulting entries to be restricted to those from the current boot\&.
52 .PP
53 Additional constraints may be added using options
54 \fB\-\-boot\fR,
55 \fB\-\-unit=\fR, etc\&., to further limit what entries will be shown (logical AND)\&.
56 .PP
57 Output is interleaved from all accessible journal files, whether they are rotated or currently being written, and regardless of whether they belong to the system itself or are accessible user journals\&. The
58 \fB\-\-header\fR
59 option can be used to identify which files
60 \fIare\fR
61 being shown\&.
62 .PP
63 The set of journal files which will be used can be modified using the
64 \fB\-\-user\fR,
65 \fB\-\-system\fR,
66 \fB\-\-directory=\fR, and
67 \fB\-\-file=\fR
68 options, see below\&.
69 .PP
70 All users are granted access to their private per\-user journals\&. However, by default, only root and users who are members of a few special groups are granted access to the system journal and the journals of other users\&. Members of the groups
71 "systemd\-journal",
72 "adm", and
73 "wheel"
74 can read all journal files\&. Note that the two latter groups traditionally have additional privileges specified by the distribution\&. Members of the
75 "wheel"
76 group can often perform administrative tasks\&.
77 .PP
78 The output is paged through
79 \fBless\fR
80 by default, and long lines are "truncated" to screen width\&. The hidden part can be viewed by using the left\-arrow and right\-arrow keys\&. Paging can be disabled; see the
81 \fB\-\-no\-pager\fR
82 option and the "Environment" section below\&.
83 .PP
84 When outputting to a tty, lines are colored according to priority: lines of level ERROR and higher are colored red; lines of level WARNING are colored yellow; lines of level NOTICE are highlighted; lines of level INFO are displayed normally; lines of level DEBUG are colored grey\&.
85 .PP
86 To write entries
87 \fIto\fR
88 the journal, a few methods may be used\&. In general, output from systemd units is automatically connected to the journal, see
89 \fBsystemd-journald.service\fR(8)\&. In addition,
90 \fBsystemd-cat\fR(1)
91 may be used to send messages to the journal directly\&.
92 .SH "SOURCE OPTIONS"
93 .PP
94 The following options control where to read journal records from:
95 .PP
96 \fB\-\-system\fR, \fB\-\-user\fR
97 .RS 4
98 Show messages from system services and the kernel (with
99 \fB\-\-system\fR)\&. Show messages from service of current user (with
100 \fB\-\-user\fR)\&. If neither is specified, show all messages that the user can see\&.
101 .sp
102 The
103 \fB\-\-user\fR
104 option affects how
105 \fB\-\-unit=\fR
106 arguments are treated\&. See
107 \fB\-\-unit=\fR\&.
108 .sp
109 Note that
110 \fB\-\-user\fR
111 only works if persistent logging is enabled, via the
112 \fIStorage=\fR
113 setting in
114 \fBjournald.conf\fR(5)\&.
115 .sp
116 Added in version 205\&.
117 .RE
118 .PP
119 \fB\-M\fR, \fB\-\-machine=\fR
120 .RS 4
121 Show messages from a running, local container\&. Specify a container name to connect to\&.
122 .sp
123 Added in version 209\&.
124 .RE
125 .PP
126 \fB\-m\fR, \fB\-\-merge\fR
127 .RS 4
128 Show entries interleaved from all available journals, including remote ones\&.
129 .sp
130 Added in version 190\&.
131 .RE
132 .PP
133 \fB\-D \fR\fB\fIDIR\fR\fR, \fB\-\-directory=\fR\fB\fIDIR\fR\fR
134 .RS 4
135 Takes a directory path as argument\&. If specified, journalctl will operate on the specified journal directory
136 \fIDIR\fR
137 instead of the default runtime and system journal paths\&.
138 .sp
139 Added in version 187\&.
140 .RE
141 .PP
142 \fB\-i \fR\fB\fIGLOB\fR\fR, \fB\-\-file=\fR\fB\fIGLOB\fR\fR
143 .RS 4
144 Takes a file glob as an argument\&. If specified, journalctl will operate on the specified journal files matching
145 \fIGLOB\fR
146 instead of the default runtime and system journal paths\&. May be specified multiple times, in which case files will be suitably interleaved\&.
147 .sp
148 Added in version 205\&.
149 .RE
150 .PP
151 \fB\-\-root=\fR\fB\fIROOT\fR\fR
152 .RS 4
153 Takes a directory path as an argument\&. If specified,
154 \fBjournalctl\fR
155 will operate on journal directories and catalog file hierarchy underneath the specified directory instead of the root directory (e\&.g\&.
156 \fB\-\-update\-catalog\fR
157 will create
158 \fIROOT\fR/var/lib/systemd/catalog/database, and journal files under
159 \fIROOT\fR/run/journal/
160 or
161 \fIROOT\fR/var/log/journal/
162 will be displayed)\&.
163 .sp
164 Added in version 201\&.
165 .RE
166 .PP
167 \fB\-\-image=\fR\fB\fIIMAGE\fR\fR
168 .RS 4
169 Takes a path to a disk image file or block device node\&. If specified,
170 \fBjournalctl\fR
171 will operate on the file system in the indicated disk image\&. This option is similar to
172 \fB\-\-root=\fR, but operates on file systems stored in disk images or block devices, thus providing an easy way to extract log data from disk images\&. The disk image should either contain just a file system or a set of file systems within a GPT partition table, following the
173 \m[blue]\fBDiscoverable Partitions Specification\fR\m[]\&\s-2\u[1]\d\s+2\&. For further information on supported disk images, see
174 \fBsystemd-nspawn\fR(1)\*(Aqs switch of the same name\&.
175 .sp
176 Added in version 247\&.
177 .RE
178 .PP
179 \fB\-\-image\-policy=\fR\fB\fIpolicy\fR\fR
180 .RS 4
181 Takes an image policy string as argument, as per
182 \fBsystemd.image-policy\fR(7)\&. The policy is enforced when operating on the disk image specified via
183 \fB\-\-image=\fR, see above\&. If not specified, defaults to the
184 "*"
185 policy, i\&.e\&. all recognized file systems in the image are used\&.
186 .RE
187 .PP
188 \fB\-\-namespace=\fR\fB\fINAMESPACE\fR\fR
189 .RS 4
190 Takes a journal namespace identifier string as argument\&. If not specified, the data collected by the default namespace is shown\&. If specified, shows the log data of the specified namespace instead\&. If the namespace is specified as
191 "*"
192 data from all namespaces is shown, interleaved\&. If the namespace identifier is prefixed with
193 "+"
194 data from the specified namespace and the default namespace is shown, interleaved, but no other\&. For details about journal namespaces see
195 \fBsystemd-journald.service\fR(8)\&.
196 .sp
197 Added in version 245\&.
198 .RE
199 .SH "FILTERING OPTIONS"
200 .PP
201 The following options control how to filter journal records:
202 .PP
203 \fB\-S\fR, \fB\-\-since=\fR, \fB\-U\fR, \fB\-\-until=\fR
204 .RS 4
205 Start showing entries on or newer than the specified date, or on or older than the specified date, respectively\&. Date specifications should be of the format
206 "2012\-10\-30 18:17:16"\&. If the time part is omitted,
207 "00:00:00"
208 is assumed\&. If only the seconds component is omitted,
209 ":00"
210 is assumed\&. If the date component is omitted, the current day is assumed\&. Alternatively the strings
211 "yesterday",
212 "today",
213 "tomorrow"
214 are understood, which refer to 00:00:00 of the day before the current day, the current day, or the day after the current day, respectively\&.
215 "now"
216 refers to the current time\&. Finally, relative times may be specified, prefixed with
217 "\-"
218 or
219 "+", referring to times before or after the current time, respectively\&. For complete time and date specification, see
220 \fBsystemd.time\fR(7)\&. Note that
221 \fB\-\-output=short\-full\fR
222 prints timestamps that follow precisely this format\&.
223 .sp
224 Added in version 195\&.
225 .RE
226 .PP
227 \fB\-c\fR, \fB\-\-cursor=\fR
228 .RS 4
229 Start showing entries from the location in the journal specified by the passed cursor\&.
230 .sp
231 Added in version 193\&.
232 .RE
233 .PP
234 \fB\-\-after\-cursor=\fR
235 .RS 4
236 Start showing entries from the location in the journal
237 \fIafter\fR
238 the location specified by the passed cursor\&. The cursor is shown when the
239 \fB\-\-show\-cursor\fR
240 option is used\&.
241 .sp
242 Added in version 206\&.
243 .RE
244 .PP
245 \fB\-\-cursor\-file=\fR\fB\fIFILE\fR\fR
246 .RS 4
247 If
248 \fIFILE\fR
249 exists and contains a cursor, start showing entries
250 \fIafter\fR
251 this location\&. Otherwise, show entries according to the other given options\&. At the end, write the cursor of the last entry to
252 \fIFILE\fR\&. Use this option to continually read the journal by sequentially calling
253 \fBjournalctl\fR\&.
254 .sp
255 Added in version 242\&.
256 .RE
257 .PP
258 \fB\-b \fR\fB[[\fIID\fR][\fI\(+-offset\fR]|\fBall\fR]\fR, \fB\-\-boot\fR\fB[=[\fIID\fR][\fI\(+-offset\fR]|\fBall\fR]\fR
259 .RS 4
260 Show messages from a specific boot\&. This will add a match for
261 "_BOOT_ID="\&.
262 .sp
263 The argument may be empty, in which case logs for the current boot will be shown\&.
264 .sp
265 If the boot ID is omitted, a positive
266 \fIoffset\fR
267 will look up the boots starting from the beginning of the journal, and an equal\-or\-less\-than zero
268 \fIoffset\fR
269 will look up boots starting from the end of the journal\&. Thus,
270 \fB1\fR
271 means the first boot found in the journal in chronological order,
272 \fB2\fR
273 the second and so on; while
274 \fB\-0\fR
275 is the last boot,
276 \fB\-1\fR
277 the boot before last, and so on\&. An empty
278 \fIoffset\fR
279 is equivalent to specifying
280 \fB\-0\fR, except when the current boot is not the last boot (e\&.g\&. because
281 \fB\-\-directory=\fR
282 was specified to look at logs from a different machine)\&.
283 .sp
284 If the 32\-character
285 \fIID\fR
286 is specified, it may optionally be followed by
287 \fIoffset\fR
288 which identifies the boot relative to the one given by boot
289 \fIID\fR\&. Negative values mean earlier boots and positive values mean later boots\&. If
290 \fIoffset\fR
291 is not specified, a value of zero is assumed, and the logs for the boot given by
292 \fIID\fR
293 are shown\&.
294 .sp
295 The special argument
296 \fBall\fR
297 can be used to negate the effect of an earlier use of
298 \fB\-b\fR\&.
299 .sp
300 Added in version 186\&.
301 .RE
302 .PP
303 \fB\-u\fR, \fB\-\-unit=\fR\fB\fIUNIT\fR\fR\fB|\fR\fB\fIPATTERN\fR\fR
304 .RS 4
305 Show messages for the specified systemd unit
306 \fIUNIT\fR
307 (such as a service unit), or for any of the units matched by
308 \fIPATTERN\fR\&. If a pattern is specified, a list of unit names found in the journal is compared with the specified pattern and all that match are used\&. For each unit name, a match is added for messages from the unit ("_SYSTEMD_UNIT=\fIUNIT\fR"), along with additional matches for messages from systemd and messages about coredumps for the specified unit\&. A match is also added for
309 "_SYSTEMD_SLICE=\fIUNIT\fR", such that if the provided
310 \fIUNIT\fR
311 is a
312 \fBsystemd.slice\fR(5)
313 unit, all logs of children of the slice will be shown\&.
314 .sp
315 With
316 \fB\-\-user\fR, all
317 \fB\-\-unit=\fR
318 arguments will be converted to match user messages as if specified with
319 \fB\-\-user\-unit=\fR\&.
320 .sp
321 This parameter can be specified multiple times\&.
322 .sp
323 Added in version 195\&.
324 .RE
325 .PP
326 \fB\-\-user\-unit=\fR
327 .RS 4
328 Show messages for the specified user session unit\&. This will add a match for messages from the unit ("_SYSTEMD_USER_UNIT="
329 and
330 "_UID=") and additional matches for messages from session systemd and messages about coredumps for the specified unit\&. A match is also added for
331 "_SYSTEMD_USER_SLICE=\fIUNIT\fR", such that if the provided
332 \fIUNIT\fR
333 is a
334 \fBsystemd.slice\fR(5)
335 unit, all logs of children of the unit will be shown\&.
336 .sp
337 This parameter can be specified multiple times\&.
338 .sp
339 Added in version 198\&.
340 .RE
341 .PP
342 \fB\-I\fR, \fB\-\-invocation=\fR\fB\fIID\fR\fR\fB[\fI\(+-offset\fR]\fR\fB|\fR\fB\fIoffset\fR\fR
343 .RS 4
344 Show messages from a specific invocation of unit\&. This will add a match for
345 "_SYSTEMD_INVOCATION_ID=",
346 "OBJECT_SYSTEMD_INVOCATION_ID=",
347 "INVOCATION_ID=",
348 "USER_INVOCATION_ID="\&.
349 .sp
350 A positive
351 \fIoffset\fR
352 will look up the invocations of a systemd unit from the beginning of the journal, and zero or a negative offset will look up invocations starting from the end of the journal\&. Thus,
353 \fB1\fR
354 means the first invocation found in the journal in chronological order,
355 \fB2\fR
356 the second and so on; while
357 \fB0\fR
358 is the latest invocation,
359 \fB\-1\fR
360 the invocation before the latest, and so on\&.
361 .sp
362 If the 32\-character
363 \fIID\fR
364 is specified, it may optionally be followed by
365 \fI\(+-offset\fR
366 which identifies the invocation relative to the one given by invocation
367 \fIID\fR\&. Negative values mean earlier invocations and positive values mean later invocations\&. If
368 \fI\(+-offset\fR
369 is not specified, a value of zero is assumed, and the logs for the invocation given by
370 \fIID\fR
371 will be shown\&.
372 .sp
373 \fB\-I\fR
374 is equivalent to
375 \fB\-\-invocation=0\fR, and logs for the latest invocation will be shown\&.
376 .sp
377 When an offset is specified, a unit name must be specified with
378 \fB\-u/\-\-unit=\fR
379 or
380 \fB\-\-user\-unit=\fR
381 option\&.
382 .sp
383 When specified with
384 \fB\-b/\-\-boot=\fR, then invocations are searched within the specified boot\&.
385 .sp
386 Added in version 257\&.
387 .RE
388 .PP
389 \fB\-t\fR, \fB\-\-identifier=\fR\fB\fISYSLOG_IDENTIFIER\fR\fR
390 .RS 4
391 Show messages for the specified syslog identifier
392 \fISYSLOG_IDENTIFIER\fR\&.
393 .sp
394 This parameter can be specified multiple times\&.
395 .sp
396 Added in version 217\&.
397 .RE
398 .PP
399 \fB\-T\fR, \fB\-\-exclude\-identifier=\fR\fB\fISYSLOG_IDENTIFIER\fR\fR
400 .RS 4
401 Exclude messages for the specified syslog identifier
402 \fISYSLOG_IDENTIFIER\fR\&.
403 .sp
404 This parameter can be specified multiple times\&.
405 .sp
406 Added in version 256\&.
407 .RE
408 .PP
409 \fB\-p\fR, \fB\-\-priority=\fR
410 .RS 4
411 Filter output by message priorities or priority ranges\&. Takes either a single numeric or textual log level (i\&.e\&. between 0/"emerg"
412 and 7/"debug"), or a range of numeric/text log levels in the form FROM\&.\&.TO\&. The log levels are the usual syslog log levels as documented in
413 \fBsyslog\fR(3), i\&.e\&.
414 "emerg"\ \&(0),
415 "alert"\ \&(1),
416 "crit"\ \&(2),
417 "err"\ \&(3),
418 "warning"\ \&(4),
419 "notice"\ \&(5),
420 "info"\ \&(6),
421 "debug"\ \&(7)\&. If a single log level is specified, all messages with this log level or a lower (hence more important) log level are shown\&. If a range is specified, all messages within the range are shown, including both the start and the end value of the range\&. This will add
422 "PRIORITY="
423 matches for the specified priorities\&.
424 .sp
425 Added in version 188\&.
426 .RE
427 .PP
428 \fB\-\-facility=\fR
429 .RS 4
430 Filter output by syslog facility\&. Takes a comma\-separated list of numbers or facility names\&. The names are the usual syslog facilities as documented in
431 \fBsyslog\fR(3)\&.
432 \fB\-\-facility=help\fR
433 may be used to display a list of known facility names and exit\&.
434 .sp
435 Added in version 245\&.
436 .RE
437 .PP
438 \fB\-g\fR, \fB\-\-grep=\fR
439 .RS 4
440 Filter output to entries where the
441 \fIMESSAGE=\fR
442 field matches the specified regular expression\&. PERL\-compatible regular expressions are used, see
443 \fBpcre2pattern\fR(3)
444 for a detailed description of the syntax\&.
445 .sp
446 If the pattern is all lowercase, matching is case insensitive\&. Otherwise, matching is case sensitive\&. This can be overridden with the
447 \fB\-\-case\-sensitive\fR
448 option, see below\&.
449 .sp
450 When used with
451 \fB\-\-lines=\fR
452 (not prefixed with
453 "+"),
454 \fB\-\-reverse\fR
455 is implied\&.
456 .sp
457 Added in version 237\&.
458 .RE
459 .PP
460 \fB\-\-case\-sensitive\fR\fB[=BOOLEAN]\fR
461 .RS 4
462 Make pattern matching case sensitive or case insensitive\&.
463 .sp
464 Added in version 237\&.
465 .RE
466 .PP
467 \fB\-k\fR, \fB\-\-dmesg\fR
468 .RS 4
469 Show only kernel messages\&. This implies
470 \fB\-b\fR
471 and adds the match
472 "_TRANSPORT=kernel"\&.
473 .sp
474 Added in version 205\&.
475 .RE
476 .SH "OUTPUT OPTIONS"
477 .PP
478 The following options control how journal records are printed:
479 .PP
480 \fB\-o\fR, \fB\-\-output=\fR
481 .RS 4
482 Controls the formatting of the journal entries that are shown\&. Takes one of the following options:
483 .PP
484 \fBshort\fR
485 .RS 4
486 is the default and generates an output that is mostly identical to the formatting of classic syslog files, showing one line per journal entry\&.
487 .sp
488 Added in version 206\&.
489 .RE
490 .PP
491 \fBshort\-full\fR
492 .RS 4
493 is very similar, but shows timestamps in the format the
494 \fB\-\-since=\fR
495 and
496 \fB\-\-until=\fR
497 options accept\&. Unlike the timestamp information shown in
498 \fBshort\fR
499 output mode this mode includes weekday, year and timezone information in the output, and is locale\-independent\&.
500 .sp
501 Added in version 232\&.
502 .RE
503 .PP
504 \fBshort\-iso\fR
505 .RS 4
506 is very similar, but shows timestamps in the
507 \m[blue]\fBRFC 3339\fR\m[]\&\s-2\u[2]\d\s+2
508 profile of ISO 8601\&.
509 .sp
510 Added in version 206\&.
511 .RE
512 .PP
513 \fBshort\-iso\-precise\fR
514 .RS 4
515 as for
516 \fBshort\-iso\fR
517 but includes full microsecond precision\&.
518 .sp
519 Added in version 234\&.
520 .RE
521 .PP
522 \fBshort\-precise\fR
523 .RS 4
524 is very similar, but shows classic syslog timestamps with full microsecond precision\&.
525 .sp
526 Added in version 207\&.
527 .RE
528 .PP
529 \fBshort\-monotonic\fR
530 .RS 4
531 is very similar, but shows monotonic timestamps instead of wallclock timestamps\&.
532 .sp
533 Added in version 206\&.
534 .RE
535 .PP
536 \fBshort\-delta\fR
537 .RS 4
538 as for
539 \fBshort\-monotonic\fR
540 but includes the time difference to the previous entry\&. Maybe unreliable time differences are marked by a
541 "*"\&.
542 .sp
543 Added in version 252\&.
544 .RE
545 .PP
546 \fBshort\-unix\fR
547 .RS 4
548 is very similar, but shows seconds passed since January 1st 1970 UTC instead of wallclock timestamps ("UNIX time")\&. The time is shown with microsecond accuracy\&.
549 .sp
550 Added in version 230\&.
551 .RE
552 .PP
553 \fBverbose\fR
554 .RS 4
555 shows the full\-structured entry items with all fields\&.
556 .sp
557 Added in version 206\&.
558 .RE
559 .PP
560 \fBexport\fR
561 .RS 4
562 serializes the journal into a binary (but mostly text\-based) stream suitable for backups and network transfer (see
563 \m[blue]\fBJournal Export Format\fR\m[]\&\s-2\u[3]\d\s+2
564 for more information)\&. To import the binary stream back into native journald format use
565 \fBsystemd-journal-remote\fR(8)\&.
566 .sp
567 Added in version 206\&.
568 .RE
569 .PP
570 \fBjson\fR
571 .RS 4
572 formats entries as JSON objects, separated by newline characters (see
573 \m[blue]\fBJournal JSON Format\fR\m[]\&\s-2\u[4]\d\s+2
574 for more information)\&. Field values are generally encoded as JSON strings, with three exceptions:
575 .sp
576 .RS 4
577 .ie n \{\
578 \h'-04' 1.\h'+01'\c
579 .\}
580 .el \{\
581 .sp -1
582 .IP " 1." 4.2
583 .\}
584 Fields larger than 4096 bytes are encoded as
585 \fBnull\fR
586 values\&. (This may be turned off by passing
587 \fB\-\-all\fR, but be aware that this may allocate overly long JSON objects\&.)
588 .RE
589 .sp
590 .RS 4
591 .ie n \{\
592 \h'-04' 2.\h'+01'\c
593 .\}
594 .el \{\
595 .sp -1
596 .IP " 2." 4.2
597 .\}
598 Journal entries permit non\-unique fields within the same log entry\&. JSON does not allow non\-unique fields within objects\&. Due to this, if a non\-unique field is encountered a JSON array is used as field value, listing all field values as elements\&.
599 .RE
600 .sp
601 .RS 4
602 .ie n \{\
603 \h'-04' 3.\h'+01'\c
604 .\}
605 .el \{\
606 .sp -1
607 .IP " 3." 4.2
608 .\}
609 Fields containing non\-printable or non\-UTF8 bytes are encoded as arrays containing the raw bytes individually formatted as unsigned numbers\&.
610 .RE
611 .sp
612 Note that this encoding is reversible (with the exception of the size limit)\&.
613 .sp
614 Added in version 206\&.
615 .RE
616 .PP
617 \fBjson\-pretty\fR
618 .RS 4
619 formats entries as JSON data structures, but formats them in multiple lines in order to make them more readable by humans\&.
620 .sp
621 Added in version 206\&.
622 .RE
623 .PP
624 \fBjson\-sse\fR
625 .RS 4
626 formats entries as JSON data structures, but wraps them in a format suitable for
627 \m[blue]\fBServer\-Sent Events\fR\m[]\&\s-2\u[5]\d\s+2\&.
628 .sp
629 Added in version 206\&.
630 .RE
631 .PP
632 \fBjson\-seq\fR
633 .RS 4
634 formats entries as JSON data structures, but prefixes them with an ASCII Record Separator character (0x1E) and suffixes them with an ASCII Line Feed character (0x0A), in accordance with
635 \m[blue]\fBJavaScript Object Notation (JSON) Text Sequences\fR\m[]\&\s-2\u[6]\d\s+2
636 ("application/json\-seq")\&.
637 .sp
638 Added in version 240\&.
639 .RE
640 .PP
641 \fBcat\fR
642 .RS 4
643 generates a very terse output, only showing the actual message of each journal entry with no metadata, not even a timestamp\&. If combined with the
644 \fB\-\-output\-fields=\fR
645 option will output the listed fields for each log record, instead of the message\&.
646 .sp
647 Added in version 206\&.
648 .RE
649 .PP
650 \fBwith\-unit\fR
651 .RS 4
652 similar to
653 \fBshort\-full\fR, but prefixes the unit and user unit names instead of the traditional syslog identifier\&. Useful when using templated instances, as it will include the arguments in the unit names\&.
654 .sp
655 Added in version 239\&.
656 .RE
657 .RE
658 .PP
659 \fB\-\-truncate\-newline\fR
660 .RS 4
661 Truncate each log message at the first newline character on output, so that only the first line of each message is displayed\&.
662 .sp
663 Added in version 254\&.
664 .RE
665 .PP
666 \fB\-\-output\-fields=\fR
667 .RS 4
668 A comma separated list of the fields which should be included in the output\&. This has an effect only for the output modes which would normally show all fields (\fBverbose\fR,
669 \fBexport\fR,
670 \fBjson\fR,
671 \fBjson\-pretty\fR,
672 \fBjson\-sse\fR
673 and
674 \fBjson\-seq\fR), as well as on
675 \fBcat\fR\&. For the former, the
676 "__CURSOR",
677 "__REALTIME_TIMESTAMP",
678 "__MONOTONIC_TIMESTAMP", and
679 "_BOOT_ID"
680 fields are always printed\&.
681 .sp
682 Added in version 236\&.
683 .RE
684 .PP
685 \fB\-n\fR, \fB\-\-lines=\fR
686 .RS 4
687 Show the most recent journal events and limit the number of events shown\&. The argument is a positive integer or
688 "all"
689 to disable the limit\&. Additionally, if the number is prefixed with
690 "+", the oldest journal events are used instead\&. The default value is 10 if no argument is given\&.
691 .sp
692 If
693 \fB\-\-follow\fR
694 is used, this option is implied\&. When not prefixed with
695 "+"
696 and used with
697 \fB\-\-grep=\fR,
698 \fB\-\-reverse\fR
699 is implied\&.
700 .RE
701 .PP
702 \fB\-r\fR, \fB\-\-reverse\fR
703 .RS 4
704 Reverse output so that the newest entries are displayed first\&.
705 .sp
706 Added in version 198\&.
707 .RE
708 .PP
709 \fB\-\-show\-cursor\fR
710 .RS 4
711 The cursor is shown after the last entry after two dashes:
712 .sp
713 .if n \{\
714 .RS 4
715 .\}
716 .nf
717 \-\- cursor: s=0639\&...
718 .fi
719 .if n \{\
720 .RE
721 .\}
722 .sp
723 The format of the cursor is private and subject to change\&.
724 .sp
725 Added in version 209\&.
726 .RE
727 .PP
728 \fB\-\-utc\fR
729 .RS 4
730 Express time in Coordinated Universal Time (UTC)\&.
731 .sp
732 Added in version 217\&.
733 .RE
734 .PP
735 \fB\-x\fR, \fB\-\-catalog\fR
736 .RS 4
737 Augment log lines with explanation texts from the message catalog\&. This will add explanatory help texts to log messages in the output where this is available\&. These short help texts will explain the context of an error or log event, possible solutions, as well as pointers to support forums, developer documentation, and any other relevant manuals\&. Note that help texts are not available for all messages, but only for selected ones\&. For more information on the message catalog, see
738 \m[blue]\fBJournal Message Catalogs\fR\m[]\&\s-2\u[7]\d\s+2\&.
739 .sp
740 Note: when attaching
741 \fBjournalctl\fR
742 output to bug reports, please do
743 \fInot\fR
744 use
745 \fB\-x\fR\&.
746 .sp
747 Added in version 196\&.
748 .RE
749 .PP
750 \fB\-\-no\-hostname\fR
751 .RS 4
752 Do not show the hostname field of log messages\&. This switch has an effect only on the
753 \fBshort\fR
754 family of output modes (see above)\&.
755 .sp
756 Note: this option does not remove occurrences of the hostname from log entries themselves, so it does not prevent the hostname from being visible in the logs\&.
757 .sp
758 Added in version 230\&.
759 .RE
760 .PP
761 \fB\-\-no\-full\fR, \fB\-\-full\fR, \fB\-l\fR
762 .RS 4
763 Ellipsize fields when they do not fit in available columns\&. The default is to show full fields, allowing them to wrap or be truncated by the pager, if one is used\&.
764 .sp
765 The old options
766 \fB\-l\fR/\fB\-\-full\fR
767 are not useful anymore, except to undo
768 \fB\-\-no\-full\fR\&.
769 .sp
770 Added in version 196\&.
771 .RE
772 .PP
773 \fB\-a\fR, \fB\-\-all\fR
774 .RS 4
775 Show all fields in full, even if they include unprintable characters or are very long\&. By default, fields with unprintable characters are abbreviated as "blob data"\&. (Note that the pager may escape unprintable characters again\&.)
776 .RE
777 .PP
778 \fB\-f\fR, \fB\-\-follow\fR
779 .RS 4
780 Show only the most recent journal entries, and continuously print new entries as they are appended to the journal\&.
781 .RE
782 .PP
783 \fB\-\-no\-tail\fR
784 .RS 4
785 Show all stored output lines, even in follow mode\&. Undoes the effect of
786 \fB\-\-lines=\fR\&.
787 .RE
788 .PP
789 \fB\-q\fR, \fB\-\-quiet\fR
790 .RS 4
791 Suppresses all informational messages (i\&.e\&. "\-\- Journal begins at \&...", "\-\- Reboot \-\-"), any warning messages regarding inaccessible system journals when run as a normal user\&.
792 .RE
793 .SH "PAGER CONTROL OPTIONS"
794 .PP
795 The following options control page support:
796 .PP
797 \fB\-\-no\-pager\fR
798 .RS 4
799 Do not pipe output into a pager\&.
800 .RE
801 .PP
802 \fB\-e\fR, \fB\-\-pager\-end\fR
803 .RS 4
804 Immediately jump to the end of the journal inside the implied pager tool\&. This implies
805 \fB\-n1000\fR
806 to guarantee that the pager will not buffer logs of unbounded size\&. This may be overridden with an explicit
807 \fB\-n\fR
808 with some other numeric value, while
809 \fB\-nall\fR
810 will disable this cap\&. Note that this option is only supported for the
811 \fBless\fR(1)
812 pager\&.
813 .sp
814 Added in version 198\&.
815 .RE
816 .SH "FORWARD SECURE SEALING (FSS) OPTIONS"
817 .PP
818 The following options may be used together with the
819 \fB\-\-setup\-keys\fR
820 command described below:
821 .PP
822 \fB\-\-interval=\fR
823 .RS 4
824 Specifies the change interval for the sealing key when generating an FSS key pair with
825 \fB\-\-setup\-keys\fR\&. Shorter intervals increase CPU consumption but shorten the time range of undetectable journal alterations\&. Defaults to 15min\&.
826 .sp
827 Added in version 189\&.
828 .RE
829 .PP
830 \fB\-\-verify\-key=\fR
831 .RS 4
832 Specifies the FSS verification key to use for the
833 \fB\-\-verify\fR
834 operation\&.
835 .sp
836 Added in version 189\&.
837 .RE
838 .PP
839 \fB\-\-force\fR
840 .RS 4
841 When
842 \fB\-\-setup\-keys\fR
843 is passed and Forward Secure Sealing (FSS) has already been configured, recreate FSS keys\&.
844 .sp
845 Added in version 206\&.
846 .RE
847 .SH "COMMANDS"
848 .PP
849 The following commands are understood\&. If none is specified the default is to display journal records:
850 .PP
851 \fB\-N\fR, \fB\-\-fields\fR
852 .RS 4
853 Print all field names currently used in all entries of the journal\&.
854 .sp
855 Added in version 229\&.
856 .RE
857 .PP
858 \fB\-F\fR, \fB\-\-field=\fR
859 .RS 4
860 Print all possible data values the specified field can take in all entries of the journal\&.
861 .sp
862 Added in version 195\&.
863 .RE
864 .PP
865 \fB\-\-list\-boots\fR
866 .RS 4
867 Show a tabular list of boot numbers (relative to the current boot), their IDs, and the timestamps of the first and last message pertaining to the boot\&. When specified with
868 \fB\-n/\-\-lines=\fR\fB[+]\fR\fB\fIN\fR\fR
869 option, only the first (when the number prefixed with
870 "+") or the last (without prefix)
871 \fIN\fR
872 entries will be shown\&. When specified with
873 \fB\-r/\-\-reverse\fR, the list will be shown in the reverse order\&.
874 .sp
875 Added in version 209\&.
876 .RE
877 .PP
878 \fB\-\-list\-invocations\fR
879 .RS 4
880 List invocation IDs of a unit\&. Requires a unit name with
881 \fB\-u/\-\-unit=\fR
882 or
883 \fB\-\-user\-unit=\fR\&. Show a tabular list of invocation numbers (relative to the current or latest invocation), their IDs, and the timestamps of the first and last message pertaining to the invocation\&. When
884 \fB\-b/\-boot\fR
885 is specified, invocations in the boot will be shown\&. When specified with
886 \fB\-n/\-\-lines=\fR\fB[+]\fR\fB\fIN\fR\fR
887 option, only the first (when the number prefixed with
888 "+") or the last (without prefix)
889 \fIN\fR
890 entries will be shown\&. When specified with
891 \fB\-r/\-\-reverse\fR, the list will be shown in the reverse order\&.
892 .sp
893 Added in version 257\&.
894 .RE
895 .PP
896 \fB\-\-disk\-usage\fR
897 .RS 4
898 Shows the current disk usage of all journal files\&. This shows the sum of the disk usage of all archived and active journal files\&.
899 .sp
900 Added in version 190\&.
901 .RE
902 .PP
903 \fB\-\-vacuum\-size=\fR, \fB\-\-vacuum\-time=\fR, \fB\-\-vacuum\-files=\fR
904 .RS 4
905 \fB\-\-vacuum\-size=\fR
906 removes the oldest archived journal files until the disk space they use falls below the specified size\&. Accepts the usual
907 "K",
908 "M",
909 "G"
910 and
911 "T"
912 suffixes (to the base of 1024)\&.
913 .sp
914 \fB\-\-vacuum\-time=\fR
915 removes archived journal files older than the specified timespan\&. Accepts the usual
916 "s"
917 (default),
918 "m",
919 "h",
920 "days",
921 "weeks",
922 "months", and
923 "years"
924 suffixes, see
925 \fBsystemd.time\fR(7)
926 for details\&.
927 .sp
928 \fB\-\-vacuum\-files=\fR
929 leaves only the specified number of separate journal files\&.
930 .sp
931 Note that running
932 \fB\-\-vacuum\-size=\fR
933 has only an indirect effect on the output shown by
934 \fB\-\-disk\-usage\fR, as the latter includes active journal files, while the vacuuming operation only operates on archived journal files\&. Similarly,
935 \fB\-\-vacuum\-files=\fR
936 might not actually reduce the number of journal files to below the specified number, as it will not remove active journal files\&.
937 .sp
938 \fB\-\-vacuum\-size=\fR,
939 \fB\-\-vacuum\-time=\fR
940 and
941 \fB\-\-vacuum\-files=\fR
942 may be combined in a single invocation to enforce any combination of a size, a time and a number of files limit on the archived journal files\&. Specifying any of these three parameters as zero is equivalent to not enforcing the specific limit, and is thus redundant\&.
943 .sp
944 These three switches may also be combined with
945 \fB\-\-rotate\fR
946 into one command\&. If so, all active files are rotated first, and the requested vacuuming operation is executed right after\&. The rotation has the effect that all currently active files are archived (and potentially new, empty journal files opened as replacement), and hence the vacuuming operation has the greatest effect as it can take all log data written so far into account\&.
947 .sp
948 Added in version 218\&.
949 .RE
950 .PP
951 \fB\-\-verify\fR
952 .RS 4
953 Check the journal file for internal consistency\&. If the file has been generated with FSS enabled and the FSS verification key has been specified with
954 \fB\-\-verify\-key=\fR, authenticity of the journal file is verified\&.
955 .sp
956 Added in version 189\&.
957 .RE
958 .PP
959 \fB\-\-sync\fR
960 .RS 4
961 Asks the journal daemon to write all yet unwritten journal data to the backing file system and synchronize all journals\&. This call does not return until the synchronization operation is complete\&. This command guarantees that any log messages written before its invocation are safely stored on disk at the time it returns\&.
962 .sp
963 Added in version 228\&.
964 .RE
965 .PP
966 \fB\-\-relinquish\-var\fR
967 .RS 4
968 Asks the journal daemon for the reverse operation to
969 \fB\-\-flush\fR: if requested the daemon will write further log data to
970 /run/log/journal/
971 and stops writing to
972 /var/log/journal/\&. A subsequent call to
973 \fB\-\-flush\fR
974 causes the log output to switch back to
975 /var/log/journal/, see above\&.
976 .sp
977 Added in version 243\&.
978 .RE
979 .PP
980 \fB\-\-smart\-relinquish\-var\fR
981 .RS 4
982 Similar to
983 \fB\-\-relinquish\-var\fR, but executes no operation if the root file system and
984 /var/log/journal/
985 reside on the same mount point\&. This operation is used during system shutdown in order to make the journal daemon stop writing data to
986 /var/log/journal/
987 in case that directory is located on a mount point that needs to be unmounted\&.
988 .sp
989 Added in version 243\&.
990 .RE
991 .PP
992 \fB\-\-flush\fR
993 .RS 4
994 Asks the journal daemon to flush any log data stored in
995 /run/log/journal/
996 into
997 /var/log/journal/, if persistent storage is enabled\&. This call does not return until the operation is complete\&. Note that this call is idempotent: the data is only flushed from
998 /run/log/journal/
999 into
1000 /var/log/journal/
1001 once during system runtime (but see
1002 \fB\-\-relinquish\-var\fR
1003 below), and this command exits cleanly without executing any operation if this has already happened\&. This command effectively guarantees that all data is flushed to
1004 /var/log/journal/
1005 at the time it returns\&.
1006 .sp
1007 Added in version 217\&.
1008 .RE
1009 .PP
1010 \fB\-\-rotate\fR
1011 .RS 4
1012 Asks the journal daemon to rotate journal files\&. This call does not return until the rotation operation is complete\&. Journal file rotation has the effect that all currently active journal files are marked as archived and renamed, so that they are never written to in future\&. New (empty) journal files are then created in their place\&. This operation may be combined with
1013 \fB\-\-vacuum\-size=\fR,
1014 \fB\-\-vacuum\-time=\fR
1015 and
1016 \fB\-\-vacuum\-file=\fR
1017 into a single command, see above\&.
1018 .sp
1019 Added in version 227\&.
1020 .RE
1021 .PP
1022 \fB\-\-header\fR
1023 .RS 4
1024 Instead of showing journal contents, show internal header information of the journal fields accessed\&.
1025 .sp
1026 This option is particularly useful when trying to identify out\-of\-order journal entries, as happens for example when the machine is booted with the wrong system time\&.
1027 .sp
1028 Added in version 187\&.
1029 .RE
1030 .PP
1031 \fB\-\-list\-catalog \fR\fB[\fI128\-bit\-ID\&...\fR]\fR
1032 .RS 4
1033 List the contents of the message catalog as a table of message IDs, plus their short description strings\&.
1034 .sp
1035 If any
1036 \fI128\-bit\-ID\fRs are specified, only those entries are shown\&.
1037 .sp
1038 Added in version 196\&.
1039 .RE
1040 .PP
1041 \fB\-\-dump\-catalog \fR\fB[\fI128\-bit\-ID\&...\fR]\fR
1042 .RS 4
1043 Show the contents of the message catalog, with entries separated by a line consisting of two dashes and the ID (the format is the same as
1044 \&.catalog
1045 files)\&.
1046 .sp
1047 If any
1048 \fI128\-bit\-ID\fRs are specified, only those entries are shown\&.
1049 .sp
1050 Added in version 199\&.
1051 .RE
1052 .PP
1053 \fB\-\-update\-catalog\fR
1054 .RS 4
1055 Update the message catalog index\&. This command needs to be executed each time new catalog files are installed, removed, or updated to rebuild the binary catalog index\&.
1056 .sp
1057 Added in version 196\&.
1058 .RE
1059 .PP
1060 \fB\-\-setup\-keys\fR
1061 .RS 4
1062 Instead of showing journal contents, generate a new key pair for Forward Secure Sealing (FSS)\&. This will generate a sealing key and a verification key\&. The sealing key is stored in the journal data directory and shall remain on the host\&. The verification key should be stored externally\&. Refer to the
1063 \fBSeal=\fR
1064 option in
1065 \fBjournald.conf\fR(5)
1066 for information on Forward Secure Sealing and for a link to a refereed scholarly paper detailing the cryptographic theory it is based on\&.
1067 .sp
1068 Added in version 189\&.
1069 .RE
1070 .PP
1071 \fB\-h\fR, \fB\-\-help\fR
1072 .RS 4
1073 Print a short help text and exit\&.
1074 .RE
1075 .PP
1076 \fB\-\-version\fR
1077 .RS 4
1078 Print a short version string and exit\&.
1079 .RE
1080 .SH "EXIT STATUS"
1081 .PP
1082 On success, 0 is returned; otherwise, a non\-zero failure code is returned\&.
1083 .SH "ENVIRONMENT"
1084 .PP
1085 \fI$SYSTEMD_LOG_LEVEL\fR
1086 .RS 4
1087 The maximum log level of emitted messages (messages with a higher log level, i\&.e\&. less important ones, will be suppressed)\&. Takes a comma\-separated list of values\&. A value may be either one of (in order of decreasing importance)
1088 \fBemerg\fR,
1089 \fBalert\fR,
1090 \fBcrit\fR,
1091 \fBerr\fR,
1092 \fBwarning\fR,
1093 \fBnotice\fR,
1094 \fBinfo\fR,
1095 \fBdebug\fR, or an integer in the range 0\&...7\&. See
1096 \fBsyslog\fR(3)
1097 for more information\&. Each value may optionally be prefixed with one of
1098 \fBconsole\fR,
1099 \fBsyslog\fR,
1100 \fBkmsg\fR
1101 or
1102 \fBjournal\fR
1103 followed by a colon to set the maximum log level for that specific log target (e\&.g\&.
1104 \fBSYSTEMD_LOG_LEVEL=debug,console:info\fR
1105 specifies to log at debug level except when logging to the console which should be at info level)\&. Note that the global maximum log level takes priority over any per target maximum log levels\&.
1106 .RE
1107 .PP
1108 \fI$SYSTEMD_LOG_COLOR\fR
1109 .RS 4
1110 A boolean\&. If true, messages written to the tty will be colored according to priority\&.
1111 .sp
1112 This setting is only useful when messages are written directly to the terminal, because
1113 \fBjournalctl\fR(1)
1114 and other tools that display logs will color messages based on the log level on their own\&.
1115 .RE
1116 .PP
1117 \fI$SYSTEMD_LOG_TIME\fR
1118 .RS 4
1119 A boolean\&. If true, console log messages will be prefixed with a timestamp\&.
1120 .sp
1121 This setting is only useful when messages are written directly to the terminal or a file, because
1122 \fBjournalctl\fR(1)
1123 and other tools that display logs will attach timestamps based on the entry metadata on their own\&.
1124 .RE
1125 .PP
1126 \fI$SYSTEMD_LOG_LOCATION\fR
1127 .RS 4
1128 A boolean\&. If true, messages will be prefixed with a filename and line number in the source code where the message originates\&.
1129 .sp
1130 Note that the log location is often attached as metadata to journal entries anyway\&. Including it directly in the message text can nevertheless be convenient when debugging programs\&.
1131 .RE
1132 .PP
1133 \fI$SYSTEMD_LOG_TID\fR
1134 .RS 4
1135 A boolean\&. If true, messages will be prefixed with the current numerical thread ID (TID)\&.
1136 .sp
1137 Note that the this information is attached as metadata to journal entries anyway\&. Including it directly in the message text can nevertheless be convenient when debugging programs\&.
1138 .RE
1139 .PP
1140 \fI$SYSTEMD_LOG_TARGET\fR
1141 .RS 4
1142 The destination for log messages\&. One of
1143 \fBconsole\fR
1144 (log to the attached tty),
1145 \fBconsole\-prefixed\fR
1146 (log to the attached tty but with prefixes encoding the log level and "facility", see
1147 \fBsyslog\fR(3),
1148 \fBkmsg\fR
1149 (log to the kernel circular log buffer),
1150 \fBjournal\fR
1151 (log to the journal),
1152 \fBjournal\-or\-kmsg\fR
1153 (log to the journal if available, and to kmsg otherwise),
1154 \fBauto\fR
1155 (determine the appropriate log target automatically, the default),
1156 \fBnull\fR
1157 (disable log output)\&.
1158 .RE
1159 .PP
1160 \fI$SYSTEMD_LOG_RATELIMIT_KMSG\fR
1161 .RS 4
1162 Whether to ratelimit kmsg or not\&. Takes a boolean\&. Defaults to
1163 "true"\&. If disabled, systemd will not ratelimit messages written to kmsg\&.
1164 .RE
1165 .PP
1166 \fI$SYSTEMD_PAGER\fR, \fI$PAGER\fR
1167 .RS 4
1168 Pager to use when
1169 \fB\-\-no\-pager\fR
1170 is not given\&.
1171 \fI$SYSTEMD_PAGER\fR
1172 is used if set; otherwise
1173 \fI$PAGER\fR
1174 is used\&. If neither
1175 \fI$SYSTEMD_PAGER\fR
1176 nor
1177 \fI$PAGER\fR
1178 are set, a set of well\-known pager implementations is tried in turn, including
1179 \fBless\fR(1)
1180 and
1181 \fBmore\fR(1), until one is found\&. If no pager implementation is discovered, no pager is invoked\&. Setting those environment variables to an empty string or the value
1182 "cat"
1183 is equivalent to passing
1184 \fB\-\-no\-pager\fR\&.
1185 .sp
1186 Note: if
1187 \fI$SYSTEMD_PAGERSECURE\fR
1188 is not set,
1189 \fI$SYSTEMD_PAGER\fR
1190 and
1191 \fI$PAGER\fR
1192 can only be used to disable the pager (with
1193 "cat"
1194 or
1195 ""), and are otherwise ignored\&.
1196 .RE
1197 .PP
1198 \fI$SYSTEMD_LESS\fR
1199 .RS 4
1200 Override the options passed to
1201 \fBless\fR
1202 (by default
1203 "FRSXMK")\&.
1204 .sp
1205 Users might want to change two options in particular:
1206 .PP
1207 \fBK\fR
1208 .RS 4
1209 This option instructs the pager to exit immediately when
1210 Ctrl+C
1211 is pressed\&. To allow
1212 \fBless\fR
1213 to handle
1214 Ctrl+C
1215 itself to switch back to the pager command prompt, unset this option\&.
1216 .sp
1217 If the value of
1218 \fI$SYSTEMD_LESS\fR
1219 does not include
1220 "K", and the pager that is invoked is
1221 \fBless\fR,
1222 Ctrl+C
1223 will be ignored by the executable, and needs to be handled by the pager\&.
1224 .RE
1225 .PP
1226 \fBX\fR
1227 .RS 4
1228 This option instructs the pager to not send termcap initialization and deinitialization strings to the terminal\&. It is set by default to allow command output to remain visible in the terminal even after the pager exits\&. Nevertheless, this prevents some pager functionality from working, in particular paged output cannot be scrolled with the mouse\&.
1229 .RE
1230 .sp
1231 Note that setting the regular
1232 \fI$LESS\fR
1233 environment variable has no effect for
1234 \fBless\fR
1235 invocations by systemd tools\&.
1236 .sp
1237 See
1238 \fBless\fR(1)
1239 for more discussion\&.
1240 .RE
1241 .PP
1242 \fI$SYSTEMD_LESSCHARSET\fR
1243 .RS 4
1244 Override the charset passed to
1245 \fBless\fR
1246 (by default
1247 "utf\-8", if the invoking terminal is determined to be UTF\-8 compatible)\&.
1248 .sp
1249 Note that setting the regular
1250 \fI$LESSCHARSET\fR
1251 environment variable has no effect for
1252 \fBless\fR
1253 invocations by systemd tools\&.
1254 .RE
1255 .PP
1256 \fI$SYSTEMD_PAGERSECURE\fR
1257 .RS 4
1258 Common pager commands like
1259 \fBless\fR(1), in addition to "paging", i\&.e\&. scrolling through the output, support opening of or writing to other files and running arbitrary shell commands\&. When commands are invoked with elevated privileges, for example under
1260 \fBsudo\fR(8)
1261 or
1262 \fBpkexec\fR(1), the pager becomes a security boundary\&. Care must be taken that only programs with strictly limited functionality are used as pagers, and unintended interactive features like opening or creation of new files or starting of subprocesses are not allowed\&. "Secure mode" for the pager may be enabled as described below,
1263 \fIif the pager supports that\fR
1264 (most pagers are not written in a way that takes this into consideration)\&. It is recommended to either explicitly enable "secure mode" or to completely disable the pager using
1265 \fB\-\-no\-pager\fR
1266 or
1267 \fIPAGER=cat\fR
1268 when allowing untrusted users to execute commands with elevated privileges\&.
1269 .sp
1270 This option takes a boolean argument\&. When set to true, the "secure mode" of the pager is enabled\&. In "secure mode",
1271 \fBLESSSECURE=1\fR
1272 will be set when invoking the pager, which instructs the pager to disable commands that open or create new files or start new subprocesses\&. Currently only
1273 \fBless\fR(1)
1274 is known to understand this variable and implement "secure mode"\&.
1275 .sp
1276 When set to false, no limitation is placed on the pager\&. Setting
1277 \fISYSTEMD_PAGERSECURE=0\fR
1278 or not removing it from the inherited environment may allow the user to invoke arbitrary commands\&.
1279 .sp
1280 When
1281 \fI$SYSTEMD_PAGERSECURE\fR
1282 is not set, systemd tools attempt to automatically figure out if "secure mode" should be enabled and whether the pager supports it\&. "Secure mode" is enabled if the effective UID is not the same as the owner of the login session, see
1283 \fBgeteuid\fR(2)
1284 and
1285 \fBsd_pid_get_owner_uid\fR(3), or when running under
1286 \fBsudo\fR(8)
1287 or similar tools (\fI$SUDO_UID\fR
1288 is set
1289 \&\s-2\u[8]\d\s+2)\&. In those cases,
1290 \fISYSTEMD_PAGERSECURE=1\fR
1291 will be set and pagers which are not known to implement "secure mode" will not be used at all\&. Note that this autodetection only covers the most common mechanisms to elevate privileges and is intended as convenience\&. It is recommended to explicitly set
1292 \fI$SYSTEMD_PAGERSECURE\fR
1293 or disable the pager\&.
1294 .sp
1295 Note that if the
1296 \fI$SYSTEMD_PAGER\fR
1297 or
1298 \fI$PAGER\fR
1299 variables are to be honoured, other than to disable the pager,
1300 \fI$SYSTEMD_PAGERSECURE\fR
1301 must be set too\&.
1302 .RE
1303 .PP
1304 \fI$SYSTEMD_COLORS\fR
1305 .RS 4
1306 Takes a boolean argument\&. When true,
1307 \fBsystemd\fR
1308 and related utilities will use colors in their output, otherwise the output will be monochrome\&. Additionally, the variable can take one of the following special values:
1309 "16",
1310 "256"
1311 to restrict the use of colors to the base 16 or 256 ANSI colors, respectively\&. This can be specified to override the automatic decision based on
1312 \fI$TERM\fR
1313 and what the console is connected to\&.
1314 .RE
1315 .PP
1316 \fI$SYSTEMD_URLIFY\fR
1317 .RS 4
1318 The value must be a boolean\&. Controls whether clickable links should be generated in the output for terminal emulators supporting this\&. This can be specified to override the decision that
1319 \fBsystemd\fR
1320 makes based on
1321 \fI$TERM\fR
1322 and other conditions\&.
1323 .RE
1324 .SH "EXAMPLES"
1325 .PP
1326 Without arguments, all collected logs are shown unfiltered:
1327 .sp
1328 .if n \{\
1329 .RS 4
1330 .\}
1331 .nf
1332 journalctl
1333 .fi
1334 .if n \{\
1335 .RE
1336 .\}
1337 .PP
1338 With one match specified, all entries with a field matching the expression are shown:
1339 .sp
1340 .if n \{\
1341 .RS 4
1342 .\}
1343 .nf
1344 journalctl _SYSTEMD_UNIT=avahi\-daemon\&.service
1345 journalctl _SYSTEMD_CGROUP=/user\&.slice/user\-42\&.slice/session\-c1\&.scope
1346 .fi
1347 .if n \{\
1348 .RE
1349 .\}
1350 .PP
1351 If two different fields are matched, only entries matching both expressions at the same time are shown:
1352 .sp
1353 .if n \{\
1354 .RS 4
1355 .\}
1356 .nf
1357 journalctl _SYSTEMD_UNIT=avahi\-daemon\&.service _PID=28097
1358 .fi
1359 .if n \{\
1360 .RE
1361 .\}
1362 .PP
1363 If two matches refer to the same field, all entries matching either expression are shown:
1364 .sp
1365 .if n \{\
1366 .RS 4
1367 .\}
1368 .nf
1369 journalctl _SYSTEMD_UNIT=avahi\-daemon\&.service _SYSTEMD_UNIT=dbus\&.service
1370 .fi
1371 .if n \{\
1372 .RE
1373 .\}
1374 .PP
1375 If the separator
1376 "+"
1377 is used, two expressions may be combined in a logical OR\&. The following will show all messages from the Avahi service process with the PID 28097 plus all messages from the D\-Bus service (from any of its processes):
1378 .sp
1379 .if n \{\
1380 .RS 4
1381 .\}
1382 .nf
1383 journalctl _SYSTEMD_UNIT=avahi\-daemon\&.service _PID=28097 + _SYSTEMD_UNIT=dbus\&.service
1384 .fi
1385 .if n \{\
1386 .RE
1387 .\}
1388 .PP
1389 To show all fields emitted
1390 \fIby\fR
1391 a unit and
1392 \fIabout\fR
1393 the unit, option
1394 \fB\-u\fR/\fB\-\-unit=\fR
1395 should be used\&.
1396 \fBjournalctl \-u \fR\fB\fIname\fR\fR
1397 expands to a complex filter similar to
1398 .sp
1399 .if n \{\
1400 .RS 4
1401 .\}
1402 .nf
1403 _SYSTEMD_UNIT=\fIname\fR\&.service
1404 + UNIT=\fIname\fR\&.service _PID=1
1405 + OBJECT_SYSTEMD_UNIT=\fIname\fR\&.service _UID=0
1406 + COREDUMP_UNIT=\fIname\fR\&.service _UID=0 MESSAGE_ID=fc2e22bc6ee647b6b90729ab34a250b1
1407 .fi
1408 .if n \{\
1409 .RE
1410 .\}
1411 .sp
1412 (see
1413 \fBsystemd.journal-fields\fR(7)
1414 for an explanation of those patterns)\&.
1415 .PP
1416 Show all logs generated by the D\-Bus executable:
1417 .sp
1418 .if n \{\
1419 .RS 4
1420 .\}
1421 .nf
1422 journalctl /usr/bin/dbus\-daemon
1423 .fi
1424 .if n \{\
1425 .RE
1426 .\}
1427 .PP
1428 Show all kernel logs from previous boot:
1429 .sp
1430 .if n \{\
1431 .RS 4
1432 .\}
1433 .nf
1434 journalctl \-k \-b \-1
1435 .fi
1436 .if n \{\
1437 .RE
1438 .\}
1439 .PP
1440 Show a live log display from a system service
1441 apache\&.service:
1442 .sp
1443 .if n \{\
1444 .RS 4
1445 .\}
1446 .nf
1447 journalctl \-f \-u apache
1448 .fi
1449 .if n \{\
1450 .RE
1451 .\}
1452 .SH "SEE ALSO"
1453 .PP
1454 \fBsystemd\fR(1), \fBsystemd-cat\fR(1), \fBsystemd-journald.service\fR(8), \fBsystemctl\fR(1), \fBcoredumpctl\fR(1), \fBsystemd.journal-fields\fR(7), \fBjournald.conf\fR(5), \fBsystemd.time\fR(7), \fBsystemd-journal-remote.service\fR(8), \fBsystemd-journal-upload.service\fR(8)
1455 .SH "NOTES"
1456 .IP " 1." 4
1457 Discoverable Partitions Specification
1458 .RS 4
1459 \%https://uapi-group.org/specifications/specs/discoverable_partitions_specification
1460 .RE
1461 .IP " 2." 4
1462 RFC 3339
1463 .RS 4
1464 \%https://tools.ietf.org/html/rfc3339
1465 .RE
1466 .IP " 3." 4
1467 Journal Export Format
1468 .RS 4
1469 \%https://systemd.io/JOURNAL_EXPORT_FORMATS#journal-export-format
1470 .RE
1471 .IP " 4." 4
1472 Journal JSON Format
1473 .RS 4
1474 \%https://systemd.io/JOURNAL_EXPORT_FORMATS#journal-json-format
1475 .RE
1476 .IP " 5." 4
1477 Server-Sent Events
1478 .RS 4
1479 \%https://developer.mozilla.org/en-US/docs/Server-sent_events/Using_server-sent_events
1480 .RE
1481 .IP " 6." 4
1482 JavaScript Object Notation (JSON) Text Sequences
1483 .RS 4
1484 \%https://tools.ietf.org/html/rfc7464
1485 .RE
1486 .IP " 7." 4
1487 Journal Message Catalogs
1488 .RS 4
1489 \%https://systemd.io/CATALOG
1490 .RE
1491 .IP " 8." 4
1492 It is recommended for other tools to set and check
1493 \fI$SUDO_UID\fR
1494 as appropriate, treating it is a common interface.
1495