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