Debian Codegraph @

upstream/debian-unstable/man1/journalctl.1

raw
1 '\" t
2 .TH "JOURNALCTL" "1" "" "systemd 261~rc3" "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]\fBUAPI\&.2 Discoverable 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 adds the match
470 "_TRANSPORT=kernel"\&. This implies
471 \fB\-\-boot=0\fR
472 unless explicitly specified otherwise\&.
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\-W\fR, \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, until Ctrl\-C is hit (or the tool is otherwise terminated)\&.
781 .sp
782 \fBjournalctl\fR
783 will send an
784 \fBsd_notify\fR(3)
785 "READY=1"
786 message once it initialized and successfully established its watch on the journal\&.
787 .RE
788 .PP
789 \fB\-\-no\-tail\fR
790 .RS 4
791 Show all stored output lines, even in follow mode\&. Undoes the effect of
792 \fB\-\-lines=\fR\&.
793 .RE
794 .PP
795 \fB\-q\fR, \fB\-\-quiet\fR
796 .RS 4
797 Suppresses all informational messages (i\&.e\&. "\-\- Journal begins at \&...", "\-\- Reboot \-\-"), any warning messages regarding inaccessible system journals when run as a normal user\&.
798 .RE
799 .PP
800 \fB\-\-synchronize\-on\-exit=\fR
801 .RS 4
802 Takes a boolean argument\&. If true and operating in
803 \fB\-\-follow\fR
804 mode, a journal synchronization request (equivalent to
805 \fBjournalctl \-\-sync\fR) is issued when
806 \fBSIGTERM\fR/\fBSIGINT\fR
807 is received, and log output continues until this request completes\&. This is useful for synchronizing journal log output to the runtime of services or external events, ensuring that any log data enqueued to the logging subsystem by the time
808 \fBSIGTERM\fR/\fBSIGINT\fR
809 is issued is guaranteed to be processed and displayed by the time log output ends\&. Defaults to false\&.
810 .sp
811 Added in version 258\&.
812 .RE
813 .SH "PAGER CONTROL OPTIONS"
814 .PP
815 The following options control page support:
816 .PP
817 \fB\-\-no\-pager\fR
818 .RS 4
819 Do not pipe output into a pager\&.
820 .RE
821 .PP
822 \fB\-e\fR, \fB\-\-pager\-end\fR
823 .RS 4
824 Immediately jump to the end of the journal inside the implied pager tool\&. This implies
825 \fB\-\-lines=1000\fR
826 and
827 \fB\-\-boot=0\fR
828 unless explicitly specified otherwise, to guarantee that the pager will not buffer logs of unbounded size\&. Note that this option is only supported for the
829 \fBless\fR(1)
830 pager\&.
831 .sp
832 Added in version 198\&.
833 .RE
834 .SH "FORWARD SECURE SEALING (FSS) OPTIONS"
835 .PP
836 The following options may be used together with the
837 \fB\-\-setup\-keys\fR
838 command described below:
839 .PP
840 \fB\-\-interval=\fR
841 .RS 4
842 Specifies the change interval for the sealing key when generating an FSS key pair with
843 \fB\-\-setup\-keys\fR\&. Shorter intervals increase CPU consumption but shorten the time range of undetectable journal alterations\&. Defaults to 15min\&.
844 .sp
845 Note,
846 \fB\-\-output=json\-sse\fR
847 and
848 \fB\-\-output=json\-seq\fR
849 are silently migrated to
850 \fB\-\-output=json\fR\&.
851 .sp
852 Added in version 189\&.
853 .RE
854 .PP
855 \fB\-\-verify\-key=\fR
856 .RS 4
857 Specifies the FSS verification key to use for the
858 \fB\-\-verify\fR
859 operation\&.
860 .sp
861 Added in version 189\&.
862 .RE
863 .PP
864 \fB\-\-force\fR
865 .RS 4
866 When
867 \fB\-\-setup\-keys\fR
868 is passed and Forward Secure Sealing (FSS) has already been configured, recreate FSS keys\&.
869 .sp
870 Added in version 206\&.
871 .RE
872 .SH "COMMANDS"
873 .PP
874 The following commands are understood\&. If none is specified the default is to display journal records:
875 .PP
876 \fB\-N\fR, \fB\-\-fields\fR
877 .RS 4
878 Print all field names currently used in all entries of the journal\&.
879 .sp
880 Added in version 229\&.
881 .RE
882 .PP
883 \fB\-F\fR, \fB\-\-field=\fR
884 .RS 4
885 Print all possible data values the specified field can take in all entries of the journal\&.
886 .sp
887 Added in version 195\&.
888 .RE
889 .PP
890 \fB\-\-list\-boots\fR
891 .RS 4
892 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
893 \fB\-n/\-\-lines=\fR\fB[+]\fR\fB\fIN\fR\fR
894 option, only the first (when the number prefixed with
895 "+") or the last (without prefix)
896 \fIN\fR
897 entries will be shown\&. When specified with
898 \fB\-r/\-\-reverse\fR, the list will be shown in the reverse order\&.
899 .sp
900 Added in version 209\&.
901 .RE
902 .PP
903 \fB\-\-list\-invocations\fR
904 .RS 4
905 List invocation IDs of a unit\&. Requires a unit name with
906 \fB\-u/\-\-unit=\fR
907 or
908 \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
909 \fB\-b/\-boot\fR
910 is specified, invocations in the boot will be shown\&. When specified with
911 \fB\-n/\-\-lines=\fR\fB[+]\fR\fB\fIN\fR\fR
912 option, only the first (when the number prefixed with
913 "+") or the last (without prefix)
914 \fIN\fR
915 entries will be shown\&. When specified with
916 \fB\-r/\-\-reverse\fR, the list will be shown in the reverse order\&.
917 .sp
918 Added in version 257\&.
919 .RE
920 .PP
921 \fB\-\-disk\-usage\fR
922 .RS 4
923 Shows the current disk usage of all journal files\&. This shows the sum of the disk usage of all archived and active journal files\&.
924 .sp
925 Added in version 190\&.
926 .RE
927 .PP
928 \fB\-\-vacuum\-size=\fR, \fB\-\-vacuum\-time=\fR, \fB\-\-vacuum\-files=\fR
929 .RS 4
930 \fB\-\-vacuum\-size=\fR
931 removes the oldest archived journal files until the disk space they use falls below the specified size\&. Accepts the usual
932 "K",
933 "M",
934 "G"
935 and
936 "T"
937 suffixes (to the base of 1024)\&.
938 .sp
939 \fB\-\-vacuum\-time=\fR
940 removes archived journal files older than the specified timespan\&. Accepts the usual
941 "s"
942 (default),
943 "m",
944 "h",
945 "days",
946 "weeks",
947 "months", and
948 "years"
949 suffixes, see
950 \fBsystemd.time\fR(7)
951 for details\&.
952 .sp
953 \fB\-\-vacuum\-files=\fR
954 leaves only the specified number of separate journal files\&.
955 .sp
956 Note that running
957 \fB\-\-vacuum\-size=\fR
958 has only an indirect effect on the output shown by
959 \fB\-\-disk\-usage\fR, as the latter includes active journal files, while the vacuuming operation only operates on archived journal files\&. Similarly,
960 \fB\-\-vacuum\-files=\fR
961 might not actually reduce the number of journal files to below the specified number, as it will not remove active journal files\&.
962 .sp
963 \fB\-\-vacuum\-size=\fR,
964 \fB\-\-vacuum\-time=\fR
965 and
966 \fB\-\-vacuum\-files=\fR
967 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\&.
968 .sp
969 These three switches may also be combined with
970 \fB\-\-rotate\fR
971 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\&.
972 .sp
973 Added in version 218\&.
974 .RE
975 .PP
976 \fB\-\-verify\fR
977 .RS 4
978 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
979 \fB\-\-verify\-key=\fR, authenticity of the journal file is verified\&.
980 .sp
981 Added in version 189\&.
982 .RE
983 .PP
984 \fB\-\-sync\fR
985 .RS 4
986 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\&.
987 .sp
988 Added in version 228\&.
989 .RE
990 .PP
991 \fB\-\-relinquish\-var\fR
992 .RS 4
993 Asks the journal daemon for the reverse operation to
994 \fB\-\-flush\fR: if requested the daemon will write further log data to
995 /run/log/journal/
996 and stops writing to
997 /var/log/journal/\&. A subsequent call to
998 \fB\-\-flush\fR
999 causes the log output to switch back to
1000 /var/log/journal/, see above\&.
1001 .sp
1002 Added in version 243\&.
1003 .RE
1004 .PP
1005 \fB\-\-smart\-relinquish\-var\fR
1006 .RS 4
1007 Similar to
1008 \fB\-\-relinquish\-var\fR, but executes no operation if the root file system and
1009 /var/log/journal/
1010 reside on the same mount point\&. This operation is used during system shutdown in order to make the journal daemon stop writing data to
1011 /var/log/journal/
1012 in case that directory is located on a mount point that needs to be unmounted\&.
1013 .sp
1014 Added in version 243\&.
1015 .RE
1016 .PP
1017 \fB\-\-flush\fR
1018 .RS 4
1019 Asks the journal daemon to flush any log data stored in
1020 /run/log/journal/
1021 into
1022 /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
1023 /run/log/journal/
1024 into
1025 /var/log/journal/
1026 once during system runtime (but see
1027 \fB\-\-relinquish\-var\fR
1028 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
1029 /var/log/journal/
1030 at the time it returns\&.
1031 .sp
1032 Added in version 217\&.
1033 .RE
1034 .PP
1035 \fB\-\-rotate\fR
1036 .RS 4
1037 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
1038 \fB\-\-vacuum\-size=\fR,
1039 \fB\-\-vacuum\-time=\fR
1040 and
1041 \fB\-\-vacuum\-file=\fR
1042 into a single command, see above\&.
1043 .sp
1044 Added in version 227\&.
1045 .RE
1046 .PP
1047 \fB\-\-header\fR
1048 .RS 4
1049 Instead of showing journal contents, show internal header information of the journal fields accessed\&.
1050 .sp
1051 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\&.
1052 .sp
1053 Added in version 187\&.
1054 .RE
1055 .PP
1056 \fB\-\-list\-catalog \fR\fB[\fI128\-bit\-ID\&...\fR]\fR
1057 .RS 4
1058 List the contents of the message catalog as a table of message IDs, plus their short description strings\&.
1059 .sp
1060 If any
1061 \fI128\-bit\-ID\fRs are specified, only those entries are shown\&.
1062 .sp
1063 Added in version 196\&.
1064 .RE
1065 .PP
1066 \fB\-\-dump\-catalog \fR\fB[\fI128\-bit\-ID\&...\fR]\fR
1067 .RS 4
1068 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
1069 \&.catalog
1070 files)\&.
1071 .sp
1072 If any
1073 \fI128\-bit\-ID\fRs are specified, only those entries are shown\&.
1074 .sp
1075 Added in version 199\&.
1076 .RE
1077 .PP
1078 \fB\-\-update\-catalog\fR
1079 .RS 4
1080 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\&.
1081 .sp
1082 Added in version 196\&.
1083 .RE
1084 .PP
1085 \fB\-\-setup\-keys\fR
1086 .RS 4
1087 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
1088 \fBSeal=\fR
1089 option in
1090 \fBjournald.conf\fR(5)
1091 for information on Forward Secure Sealing and for a link to a refereed scholarly paper detailing the cryptographic theory it is based on\&.
1092 .sp
1093 Added in version 189\&.
1094 .RE
1095 .PP
1096 \fB\-h\fR, \fB\-\-help\fR
1097 .RS 4
1098 Print a short help text and exit\&.
1099 .RE
1100 .PP
1101 \fB\-\-version\fR
1102 .RS 4
1103 Print a short version string and exit\&.
1104 .RE
1105 .SH "EXIT STATUS"
1106 .PP
1107 On success, 0 is returned; otherwise, a non\-zero failure code is returned\&.
1108 .SH "ENVIRONMENT"
1109 .PP
1110 \fI$SYSTEMD_LOG_LEVEL\fR
1111 .RS 4
1112 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)
1113 \fBemerg\fR,
1114 \fBalert\fR,
1115 \fBcrit\fR,
1116 \fBerr\fR,
1117 \fBwarning\fR,
1118 \fBnotice\fR,
1119 \fBinfo\fR,
1120 \fBdebug\fR, or an integer in the range 0\&...7\&. See
1121 \fBsyslog\fR(3)
1122 for more information\&. Each value may optionally be prefixed with one of
1123 \fBconsole\fR,
1124 \fBsyslog\fR,
1125 \fBkmsg\fR
1126 or
1127 \fBjournal\fR
1128 followed by a colon to set the maximum log level for that specific log target (e\&.g\&.
1129 \fBSYSTEMD_LOG_LEVEL=debug,console:info\fR
1130 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\&.
1131 .RE
1132 .PP
1133 \fI$SYSTEMD_LOG_COLOR\fR
1134 .RS 4
1135 A boolean\&. If true, messages written to the tty will be colored according to priority\&.
1136 .sp
1137 This setting is only useful when messages are written directly to the terminal, because
1138 \fBjournalctl\fR(1)
1139 and other tools that display logs will color messages based on the log level on their own\&.
1140 .RE
1141 .PP
1142 \fI$SYSTEMD_LOG_TIME\fR
1143 .RS 4
1144 A boolean\&. If true, console log messages will be prefixed with a timestamp\&.
1145 .sp
1146 This setting is only useful when messages are written directly to the terminal or a file, because
1147 \fBjournalctl\fR(1)
1148 and other tools that display logs will attach timestamps based on the entry metadata on their own\&.
1149 .RE
1150 .PP
1151 \fI$SYSTEMD_LOG_LOCATION\fR
1152 .RS 4
1153 A boolean\&. If true, messages will be prefixed with a filename and line number in the source code where the message originates\&.
1154 .sp
1155 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\&.
1156 .RE
1157 .PP
1158 \fI$SYSTEMD_LOG_TID\fR
1159 .RS 4
1160 A boolean\&. If true, messages will be prefixed with the current numerical thread ID (TID)\&.
1161 .sp
1162 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\&.
1163 .RE
1164 .PP
1165 \fI$SYSTEMD_LOG_TARGET\fR
1166 .RS 4
1167 The destination for log messages\&. One of
1168 \fBconsole\fR
1169 (log to the attached tty),
1170 \fBconsole\-prefixed\fR
1171 (log to the attached tty but with prefixes encoding the log level and "facility", see
1172 \fBsyslog\fR(3),
1173 \fBkmsg\fR
1174 (log to the kernel circular log buffer),
1175 \fBjournal\fR
1176 (log to the journal),
1177 \fBjournal\-or\-kmsg\fR
1178 (log to the journal if available, and to kmsg otherwise),
1179 \fBauto\fR
1180 (determine the appropriate log target automatically, the default),
1181 \fBnull\fR
1182 (disable log output)\&.
1183 .RE
1184 .PP
1185 \fI$SYSTEMD_LOG_RATELIMIT_KMSG\fR
1186 .RS 4
1187 Whether to ratelimit kmsg or not\&. Takes a boolean\&. Defaults to
1188 "true"\&. If disabled, systemd will not ratelimit messages written to kmsg\&.
1189 .RE
1190 .PP
1191 \fI$SYSTEMD_PAGER\fR, \fI$PAGER\fR
1192 .RS 4
1193 Pager to use when
1194 \fB\-\-no\-pager\fR
1195 is not given\&.
1196 \fI$SYSTEMD_PAGER\fR
1197 is used if set; otherwise
1198 \fI$PAGER\fR
1199 is used\&. If neither
1200 \fI$SYSTEMD_PAGER\fR
1201 nor
1202 \fI$PAGER\fR
1203 are set, a set of well\-known pager implementations is tried in turn, including
1204 \fBless\fR(1)
1205 and
1206 \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
1207 "cat"
1208 is equivalent to passing
1209 \fB\-\-no\-pager\fR\&.
1210 .sp
1211 Note: if
1212 \fI$SYSTEMD_PAGERSECURE\fR
1213 is not set,
1214 \fI$SYSTEMD_PAGER\fR
1215 and
1216 \fI$PAGER\fR
1217 can only be used to disable the pager (with
1218 "cat"
1219 or
1220 ""), and are otherwise ignored\&.
1221 .RE
1222 .PP
1223 \fI$SYSTEMD_LESS\fR
1224 .RS 4
1225 Override the options passed to
1226 \fBless\fR
1227 (by default
1228 "FRSXMK")\&.
1229 .sp
1230 Users might want to change two options in particular:
1231 .PP
1232 \fBK\fR
1233 .RS 4
1234 This option instructs the pager to exit immediately when
1235 Ctrl+C
1236 is pressed\&. To allow
1237 \fBless\fR
1238 to handle
1239 Ctrl+C
1240 itself to switch back to the pager command prompt, unset this option\&.
1241 .sp
1242 If the value of
1243 \fI$SYSTEMD_LESS\fR
1244 does not include
1245 "K", and the pager that is invoked is
1246 \fBless\fR,
1247 Ctrl+C
1248 will be ignored by the executable, and needs to be handled by the pager\&.
1249 .RE
1250 .PP
1251 \fBX\fR
1252 .RS 4
1253 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\&.
1254 .RE
1255 .sp
1256 Note that setting the regular
1257 \fI$LESS\fR
1258 environment variable has no effect for
1259 \fBless\fR
1260 invocations by systemd tools\&.
1261 .sp
1262 See
1263 \fBless\fR(1)
1264 for more discussion\&.
1265 .RE
1266 .PP
1267 \fI$SYSTEMD_LESSCHARSET\fR
1268 .RS 4
1269 Override the charset passed to
1270 \fBless\fR
1271 (by default
1272 "utf\-8", if the invoking terminal is determined to be UTF\-8 compatible)\&.
1273 .sp
1274 Note that setting the regular
1275 \fI$LESSCHARSET\fR
1276 environment variable has no effect for
1277 \fBless\fR
1278 invocations by systemd tools\&.
1279 .RE
1280 .PP
1281 \fI$SYSTEMD_PAGERSECURE\fR
1282 .RS 4
1283 Common pager commands like
1284 \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
1285 \fBsudo\fR(8)
1286 or
1287 \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,
1288 \fIif the pager supports that\fR
1289 (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
1290 \fB\-\-no\-pager\fR
1291 or
1292 \fIPAGER=cat\fR
1293 when allowing untrusted users to execute commands with elevated privileges\&.
1294 .sp
1295 This option takes a boolean argument\&. When set to true, the "secure mode" of the pager is enabled\&. In "secure mode",
1296 \fBLESSSECURE=1\fR
1297 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
1298 \fBless\fR(1)
1299 is known to understand this variable and implement "secure mode"\&.
1300 .sp
1301 When set to false, no limitation is placed on the pager\&. Setting
1302 \fISYSTEMD_PAGERSECURE=0\fR
1303 or not removing it from the inherited environment may allow the user to invoke arbitrary commands\&.
1304 .sp
1305 When
1306 \fI$SYSTEMD_PAGERSECURE\fR
1307 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
1308 \fBgeteuid\fR(2)
1309 and
1310 \fBsd_pid_get_owner_uid\fR(3), or when running under
1311 \fBsudo\fR(8)
1312 or similar tools (\fI$SUDO_UID\fR
1313 is set
1314 \&\s-2\u[8]\d\s+2)\&. In those cases,
1315 \fISYSTEMD_PAGERSECURE=1\fR
1316 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
1317 \fI$SYSTEMD_PAGERSECURE\fR
1318 or disable the pager\&.
1319 .sp
1320 Note that if the
1321 \fI$SYSTEMD_PAGER\fR
1322 or
1323 \fI$PAGER\fR
1324 variables are to be honoured, other than to disable the pager,
1325 \fI$SYSTEMD_PAGERSECURE\fR
1326 must be set too\&.
1327 .RE
1328 .PP
1329 \fI$SYSTEMD_COLORS\fR
1330 .RS 4
1331 Takes a boolean argument, or a special value\&. By default (unset),
1332 \fBsystemd\fR
1333 and related utilities will use colors in their output if possible\&. If
1334 \fI$COLORTERM\fR
1335 is set to
1336 "truecolor"
1337 or
1338 "24bit", 24\-bit colors will be enabled, 256 colors otherwise, unless
1339 \fI$NO_COLOR\fR
1340 or
1341 \fI$TERM\fR
1342 indicates colors are disabled\&.
1343 .PP
1344 \fBtrue\fR
1345 .RS 4
1346 Same as unset, except that
1347 \fI$NO_COLOR\fR
1348 is ignored\&.
1349 .RE
1350 .PP
1351 \fBfalse\fR
1352 .RS 4
1353 The output will be monochrome\&.
1354 .RE
1355 .PP
1356 "16", "256", "24bit"
1357 .RS 4
1358 Always use the base 16 ANSI colors, 256 colors, or 24 bit color, respectively\&.
1359 .RE
1360 .PP
1361 "auto\-16", "auto\-256", "auto\-24bit"
1362 .RS 4
1363 Use the given quantity of colours, subject to
1364 \fI$TERM\fR, and what the console is connected to\&.
1365 .RE
1366 .RE
1367 .PP
1368 \fI$SYSTEMD_URLIFY\fR
1369 .RS 4
1370 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
1371 \fBsystemd\fR
1372 makes based on
1373 \fI$TERM\fR
1374 and other conditions\&.
1375 .RE
1376 .SH "EXAMPLES"
1377 .PP
1378 Without arguments, all collected logs are shown unfiltered:
1379 .sp
1380 .if n \{\
1381 .RS 4
1382 .\}
1383 .nf
1384 journalctl
1385 .fi
1386 .if n \{\
1387 .RE
1388 .\}
1389 .PP
1390 With one match specified, all entries with a field matching the expression are shown:
1391 .sp
1392 .if n \{\
1393 .RS 4
1394 .\}
1395 .nf
1396 journalctl _SYSTEMD_UNIT=avahi\-daemon\&.service
1397 journalctl _SYSTEMD_CGROUP=/user\&.slice/user\-42\&.slice/session\-c1\&.scope
1398 .fi
1399 .if n \{\
1400 .RE
1401 .\}
1402 .PP
1403 If two different fields are matched, only entries matching both expressions at the same time are shown:
1404 .sp
1405 .if n \{\
1406 .RS 4
1407 .\}
1408 .nf
1409 journalctl _SYSTEMD_UNIT=avahi\-daemon\&.service _PID=28097
1410 .fi
1411 .if n \{\
1412 .RE
1413 .\}
1414 .PP
1415 If two matches refer to the same field, all entries matching either expression are shown:
1416 .sp
1417 .if n \{\
1418 .RS 4
1419 .\}
1420 .nf
1421 journalctl _SYSTEMD_UNIT=avahi\-daemon\&.service _SYSTEMD_UNIT=dbus\&.service
1422 .fi
1423 .if n \{\
1424 .RE
1425 .\}
1426 .PP
1427 If the separator
1428 "+"
1429 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):
1430 .sp
1431 .if n \{\
1432 .RS 4
1433 .\}
1434 .nf
1435 journalctl _SYSTEMD_UNIT=avahi\-daemon\&.service _PID=28097 + _SYSTEMD_UNIT=dbus\&.service
1436 .fi
1437 .if n \{\
1438 .RE
1439 .\}
1440 .PP
1441 To show all fields emitted
1442 \fIby\fR
1443 a unit and
1444 \fIabout\fR
1445 the unit, option
1446 \fB\-u\fR/\fB\-\-unit=\fR
1447 should be used\&.
1448 \fBjournalctl \-u \fR\fB\fIname\fR\fR
1449 expands to a complex filter similar to
1450 .sp
1451 .if n \{\
1452 .RS 4
1453 .\}
1454 .nf
1455 _SYSTEMD_UNIT=\fIname\fR\&.service
1456 + UNIT=\fIname\fR\&.service _PID=1
1457 + OBJECT_SYSTEMD_UNIT=\fIname\fR\&.service _UID=0
1458 + COREDUMP_UNIT=\fIname\fR\&.service _UID=0 MESSAGE_ID=fc2e22bc6ee647b6b90729ab34a250b1
1459 .fi
1460 .if n \{\
1461 .RE
1462 .\}
1463 .sp
1464 (see
1465 \fBsystemd.journal-fields\fR(7)
1466 for an explanation of those patterns)\&.
1467 .PP
1468 Show all logs generated by the D\-Bus executable:
1469 .sp
1470 .if n \{\
1471 .RS 4
1472 .\}
1473 .nf
1474 journalctl /usr/bin/dbus\-daemon
1475 .fi
1476 .if n \{\
1477 .RE
1478 .\}
1479 .PP
1480 Show all kernel logs from previous boot:
1481 .sp
1482 .if n \{\
1483 .RS 4
1484 .\}
1485 .nf
1486 journalctl \-k \-b \-1
1487 .fi
1488 .if n \{\
1489 .RE
1490 .\}
1491 .PP
1492 Show a live log display from a system service
1493 apache\&.service:
1494 .sp
1495 .if n \{\
1496 .RS 4
1497 .\}
1498 .nf
1499 journalctl \-f \-u apache
1500 .fi
1501 .if n \{\
1502 .RE
1503 .\}
1504 .SH "SEE ALSO"
1505 .PP
1506 \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)
1507 .SH "NOTES"
1508 .IP " 1." 4
1509 UAPI.2 Discoverable Partitions Specification
1510 .RS 4
1511 \%https://uapi-group.org/specifications/specs/discoverable_partitions_specification
1512 .RE
1513 .IP " 2." 4
1514 RFC 3339
1515 .RS 4
1516 \%https://tools.ietf.org/html/rfc3339
1517 .RE
1518 .IP " 3." 4
1519 Journal Export Format
1520 .RS 4
1521 \%https://systemd.io/JOURNAL_EXPORT_FORMATS#journal-export-format
1522 .RE
1523 .IP " 4." 4
1524 Journal JSON Format
1525 .RS 4
1526 \%https://systemd.io/JOURNAL_EXPORT_FORMATS#journal-json-format
1527 .RE
1528 .IP " 5." 4
1529 Server-Sent Events
1530 .RS 4
1531 \%https://developer.mozilla.org/en-US/docs/Server-sent_events/Using_server-sent_events
1532 .RE
1533 .IP " 6." 4
1534 JavaScript Object Notation (JSON) Text Sequences
1535 .RS 4
1536 \%https://tools.ietf.org/html/rfc7464
1537 .RE
1538 .IP " 7." 4
1539 Journal Message Catalogs
1540 .RS 4
1541 \%https://systemd.io/CATALOG
1542 .RE
1543 .IP " 8." 4
1544 It is recommended for other tools to set and check
1545 \fI$SUDO_UID\fR
1546 as appropriate, treating it is a common interface.
1547