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