~ubuntu-branches/ubuntu/trusty/systemd/trusty

« back to all changes in this revision

Viewing changes to man/journalctl.1

Tags: upstream-202
ImportĀ upstreamĀ versionĀ 202

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
'\" t
2
 
.\"     Title: journalctl
3
 
.\"    Author: Lennart Poettering <lennart@poettering.net>
4
 
.\" Generator: DocBook XSL Stylesheets v1.77.1 <http://docbook.sf.net/>
5
 
.\"      Date: 03/07/2013
6
 
.\"    Manual: journalctl
7
 
.\"    Source: systemd
8
 
.\"  Language: English
9
 
.\"
10
 
.TH "JOURNALCTL" "1" "" "systemd" "journalctl"
11
 
.\" -----------------------------------------------------------------
12
 
.\" * Define some portability stuff
13
 
.\" -----------------------------------------------------------------
14
 
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15
 
.\" http://bugs.debian.org/507673
16
 
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17
 
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18
 
.ie \n(.g .ds Aq \(aq
19
 
.el       .ds Aq '
20
 
.\" -----------------------------------------------------------------
21
 
.\" * set default formatting
22
 
.\" -----------------------------------------------------------------
23
 
.\" disable hyphenation
24
 
.nh
25
 
.\" disable justification (adjust text to left margin only)
26
 
.ad l
27
 
.\" -----------------------------------------------------------------
28
 
.\" * MAIN CONTENT STARTS HERE *
29
 
.\" -----------------------------------------------------------------
30
 
.SH "NAME"
31
 
journalctl \- Query the systemd journal
32
 
.SH "SYNOPSIS"
33
 
.HP \w'\fBjournalctl\ \fR\fB[OPTIONS...]\fR\fB\ \fR\fB[MATCHES...]\fR\ 'u
34
 
\fBjournalctl \fR\fB[OPTIONS...]\fR\fB \fR\fB[MATCHES...]\fR
35
 
.SH "DESCRIPTION"
36
 
.PP
37
 
\fBjournalctl\fR
38
 
may be used to query the contents of the
39
 
\fBsystemd\fR(1)
40
 
journal as written by
41
 
\fBsystemd-journald.service\fR(8)\&.
42
 
.PP
43
 
If called without parameter it will show the full contents of the journal, starting with the oldest entry collected\&.
44
 
.PP
45
 
If one or more match arguments are passed the output is filtered accordingly\&. A match is in the format
46
 
FIELD=VALUE, e\&.g\&.
47
 
_SYSTEMD_UNIT=httpd\&.service, referring to the components of a structured journal entry\&. See
48
 
\fBsystemd.journal-fields\fR(7)
49
 
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, if the character "+" appears as separate word on the command line all matches before and after are combined in a disjunction (i\&.e\&. logical OR)\&.
50
 
.PP
51
 
As shortcuts for a few types of field/value matches file paths may be specified\&. If a file path refers to an executable file, this is equivalent to an
52
 
_EXE=
53
 
match for the canonicalized binary path\&. Similar, if a path refers to a device node, this is equivalent to a
54
 
_KERNEL_DEVICE=
55
 
match for the device\&.
56
 
.PP
57
 
Output is interleaved from all accessible journal files, whether they are rotated or currently being written, and regardless whether they belong to the system itself or are accessible user journals\&.
58
 
.PP
59
 
All users are granted access to their private per\-user journals\&. However, by default only root and users who are members of the
60
 
adm
61
 
group get access to the system journal and the journals of other users\&.
62
 
.SH "OPTIONS"
63
 
.PP
64
 
The following options are understood:
65
 
.PP
66
 
\fB\-h\fR, \fB\-\-help\fR
67
 
.RS 4
68
 
Prints a short help text and exits\&.
69
 
.RE
70
 
.PP
71
 
\fB\-\-version\fR
72
 
.RS 4
73
 
Prints a short version string and exits\&.
74
 
.RE
75
 
.PP
76
 
\fB\-\-no\-pager\fR
77
 
.RS 4
78
 
Do not pipe output into a pager\&.
79
 
.RE
80
 
.PP
81
 
\fB\-\-full\fR
82
 
.RS 4
83
 
Show all (printable) fields in full\&.
84
 
.RE
85
 
.PP
86
 
\fB\-a\fR, \fB\-\-all\fR
87
 
.RS 4
88
 
Show all fields in full, even if they include unprintable characters or are very long\&.
89
 
.RE
90
 
.PP
91
 
\fB\-f\fR, \fB\-\-follow\fR
92
 
.RS 4
93
 
Show only the most recent journal entries, and continuously print new entries as they are appended to the journal\&.
94
 
.RE
95
 
.PP
96
 
\fB\-e\fR, \fB\-\-pager\-end\fR
97
 
.RS 4
98
 
Immediately jump to the end of the journal inside the implied pager tool\&. This implies
99
 
\fB\-n1000\fR
100
 
to guarantee that the pager won\*(Aqt buffer logs of unbounded size\&. This may be overriden with an explicit
101
 
\fB\-n\fR
102
 
with some other numeric value on the command line\&. Note that this option is only supported for the
103
 
\fBless\fR(1)
104
 
pager\&.
105
 
.RE
106
 
.PP
107
 
\fB\-n\fR, \fB\-\-lines=\fR
108
 
.RS 4
109
 
Show the most recent journal events and limit the number of events shown\&. If
110
 
\fB\-\-follow\fR
111
 
is used, this option is implied\&. The argument, a positive integer, is optional, and defaults to 10\&.
112
 
.RE
113
 
.PP
114
 
\fB\-\-no\-tail\fR
115
 
.RS 4
116
 
Show all stored output lines, even in follow mode\&. Undoes the effect of
117
 
\fB\-\-lines=\fR\&.
118
 
.RE
119
 
.PP
120
 
\fB\-r\fR, \fB\-\-reverse\fR
121
 
.RS 4
122
 
Reverse output, so the newest entries are displayed first\&.
123
 
.RE
124
 
.PP
125
 
\fB\-o\fR, \fB\-\-output=\fR
126
 
.RS 4
127
 
Controls the formatting of the journal entries that are shown\&. Takes one of
128
 
short,
129
 
short\-monotonic,
130
 
verbose,
131
 
export,
132
 
json,
133
 
json\-pretty,
134
 
json\-sse,
135
 
cat\&.
136
 
short
137
 
is the default and generates an output that is mostly identical to the formatting of classic syslog log files, showing one line per journal entry\&.
138
 
short\-monotonic
139
 
is very similar but shows monotonic timestamps instead of wallclock timestamps\&.
140
 
verbose
141
 
shows the full structured entry items with all fields\&.
142
 
export
143
 
serializes the journal into a binary (but mostly text\-based) stream suitable for backups and network transfer (see
144
 
\m[blue]\fBJournal Export Format\fR\m[]\&\s-2\u[1]\d\s+2
145
 
for more information)\&.
146
 
json
147
 
formats entries as JSON data structures, one per line (see
148
 
\m[blue]\fBJournal JSON Format\fR\m[]\&\s-2\u[2]\d\s+2
149
 
for more information)\&.
150
 
json\-pretty
151
 
also formats entries as JSON data structures, but formats them in multiple lines in order to make them more readable for humans\&.
152
 
json\-sse
153
 
also formats entries as JSON data structures, but wraps them in a format suitable for
154
 
\m[blue]\fBServer\-Sent Events\fR\m[]\&\s-2\u[3]\d\s+2\&.
155
 
cat
156
 
generates a very terse output only showing the actual message of each journal entry with no meta data, not even a timestamp\&.
157
 
.RE
158
 
.PP
159
 
\fB\-x\fR, \fB\-\-catalog\fR
160
 
.RS 4
161
 
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 please refer to the
162
 
\m[blue]\fBMessage Catalog Developer Documentation\fR\m[]\&\s-2\u[4]\d\s+2\&.
163
 
.RE
164
 
.PP
165
 
\fB\-q\fR, \fB\-\-quiet\fR
166
 
.RS 4
167
 
Suppresses any warning message regarding inaccessible system journals when run as normal user\&.
168
 
.RE
169
 
.PP
170
 
\fB\-m\fR, \fB\-\-merge\fR
171
 
.RS 4
172
 
Show entries interleaved from all available journals, including remote ones\&.
173
 
.RE
174
 
.PP
175
 
\fB\-b\fR, \fB\-\-this\-boot\fR
176
 
.RS 4
177
 
Show data only from current boot\&. This will add a match for
178
 
_BOOT_ID=
179
 
for the current boot ID of the kernel\&.
180
 
.RE
181
 
.PP
182
 
\fB\-u\fR, \fB\-\-unit=\fR
183
 
.RS 4
184
 
Show data only of the specified unit\&. This will add a match for
185
 
_SYSTEMD_UNIT=
186
 
for the specified unit\&.
187
 
.RE
188
 
.PP
189
 
\fB\-\-user\-unit=\fR
190
 
.RS 4
191
 
Show data only of the specified user session unit\&. This will add a match for
192
 
_SYSTEMD_USER_UNIT=
193
 
for the specified unit\&.
194
 
.RE
195
 
.PP
196
 
\fB\-p\fR, \fB\-\-priority=\fR
197
 
.RS 4
198
 
Filter output by message priorities or priority ranges\&. Takes either a single numeric or textual log level (i\&.e\&. between 0/emerg
199
 
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
200
 
\fBsyslog\fR(3), i\&.e\&.
201
 
emerg
202
 
(0),
203
 
alert
204
 
(1),
205
 
crit
206
 
(2),
207
 
err
208
 
(3),
209
 
warning
210
 
(4),
211
 
notice
212
 
(5),
213
 
info
214
 
(6),
215
 
debug
216
 
(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
217
 
PRIORITY=
218
 
matches for the specified priorities\&.
219
 
.RE
220
 
.PP
221
 
\fB\-c\fR, \fB\-\-cursor=\fR
222
 
.RS 4
223
 
Start showing entries from the location in the journal specified by the passed cursor\&.
224
 
.RE
225
 
.PP
226
 
\fB\-\-since=\fR, \fB\-\-until=\fR
227
 
.RS 4
228
 
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 "2012\-10\-30 18:17:16"\&. If the time part is omitted, 00:00:00 is assumed\&. If only the seconds component is omitted, :00 is assumed\&. If the date component is omitted, the current day is assumed\&. Alternatively the strings
229
 
yesterday,
230
 
today,
231
 
tomorrow
232
 
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\&.
233
 
now
234
 
refers to the current time\&. Finally, relative times may be specified, prefixed with
235
 
\-
236
 
or
237
 
+, referring to times before or after the current time, respectively\&.
238
 
.RE
239
 
.PP
240
 
\fB\-F\fR, \fB\-\-field=\fR
241
 
.RS 4
242
 
Print all possible data values the specified field can take in all entries of the journal\&.
243
 
.RE
244
 
.PP
245
 
\fB\-D\fR, \fB\-\-directory=\fR
246
 
.RS 4
247
 
Takes an absolute directory path as argument\&. If specified journalctl will operate on the specified journal directory instead of the default runtime and system journal paths\&.
248
 
.RE
249
 
.PP
250
 
\fB\-\-new\-id128\fR
251
 
.RS 4
252
 
Instead of showing journal contents generate a new 128 bit ID suitable for identifying messages\&. This is intended for usage by developers who need a new identifier for a new message they introduce and want to make recognizable\&. Will print the new ID in three different formats which can be copied into source code or similar\&.
253
 
.RE
254
 
.PP
255
 
\fB\-\-header\fR
256
 
.RS 4
257
 
Instead of showing journal contents show internal header information of the journal fields accessed\&.
258
 
.RE
259
 
.PP
260
 
\fB\-\-disk\-usage\fR
261
 
.RS 4
262
 
Shows the current disk usage of all journal files\&.
263
 
.RE
264
 
.PP
265
 
\fB\-\-list\-catalog\fR
266
 
.RS 4
267
 
List the contents of the message catalog, as table of message IDs plus their short description strings\&.
268
 
.RE
269
 
.PP
270
 
\fB\-\-update\-catalog\fR
271
 
.RS 4
272
 
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\&.
273
 
.RE
274
 
.PP
275
 
\fB\-\-setup\-keys\fR
276
 
.RS 4
277
 
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\&.
278
 
.RE
279
 
.PP
280
 
\fB\-\-interval=\fR
281
 
.RS 4
282
 
Specifies the change interval for the sealing key, when generating an FSS key pair with
283
 
\fB\-\-setup\-keys\fR\&. Shorter intervals increase CPU consumption but shorten the time range of undetectable journal alterations\&. Defaults to 15min\&.
284
 
.RE
285
 
.PP
286
 
\fB\-\-verify\fR
287
 
.RS 4
288
 
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
289
 
\fB\-\-verify\-key=\fR
290
 
authenticity of the journal file is verified\&.
291
 
.RE
292
 
.PP
293
 
\fB\-\-verify\-key=\fR
294
 
.RS 4
295
 
Specifies the FSS verification key to use for the
296
 
\fB\-\-verify\fR
297
 
operation\&.
298
 
.RE
299
 
.SH "EXIT STATUS"
300
 
.PP
301
 
On success 0 is returned, a non\-zero failure code otherwise\&.
302
 
.SH "ENVIRONMENT"
303
 
.PP
304
 
\fI$SYSTEMD_PAGER\fR
305
 
.RS 4
306
 
Pager to use when
307
 
\fB\-\-no\-pager\fR
308
 
is not given; overrides
309
 
\fI$PAGER\fR\&. Setting this to an empty string or the value
310
 
cat
311
 
is equivalent to passing
312
 
\fB\-\-no\-pager\fR\&.
313
 
.RE
314
 
.SH "EXAMPLES"
315
 
.PP
316
 
Without arguments all collected logs are shown unfiltered:
317
 
.sp
318
 
.if n \{\
319
 
.RS 4
320
 
.\}
321
 
.nf
322
 
journalctl
323
 
.fi
324
 
.if n \{\
325
 
.RE
326
 
.\}
327
 
.PP
328
 
With one match specified all entries with a field matching the expression are shown:
329
 
.sp
330
 
.if n \{\
331
 
.RS 4
332
 
.\}
333
 
.nf
334
 
journalctl _SYSTEMD_UNIT=avahi\-daemon\&.service
335
 
.fi
336
 
.if n \{\
337
 
.RE
338
 
.\}
339
 
.PP
340
 
If two different fields are matched only entries matching both expressions at the same time are shown:
341
 
.sp
342
 
.if n \{\
343
 
.RS 4
344
 
.\}
345
 
.nf
346
 
journalctl _SYSTEMD_UNIT=avahi\-daemon\&.service _PID=28097
347
 
.fi
348
 
.if n \{\
349
 
.RE
350
 
.\}
351
 
.PP
352
 
If two matches refer to the same field all entries matching either expression are shown:
353
 
.sp
354
 
.if n \{\
355
 
.RS 4
356
 
.\}
357
 
.nf
358
 
journalctl _SYSTEMD_UNIT=avahi\-daemon\&.service _SYSTEMD_UNIT=dbus\&.service
359
 
.fi
360
 
.if n \{\
361
 
.RE
362
 
.\}
363
 
.PP
364
 
If the separator "+" 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):
365
 
.sp
366
 
.if n \{\
367
 
.RS 4
368
 
.\}
369
 
.nf
370
 
journalctl _SYSTEMD_UNIT=avahi\-daemon\&.service _PID=28097 + _SYSTEMD_UNIT=dbus\&.service
371
 
.fi
372
 
.if n \{\
373
 
.RE
374
 
.\}
375
 
.PP
376
 
Show all logs generated by the D\-Bus executable:
377
 
.sp
378
 
.if n \{\
379
 
.RS 4
380
 
.\}
381
 
.nf
382
 
journalctl /usr/bin/dbus\-daemon
383
 
.fi
384
 
.if n \{\
385
 
.RE
386
 
.\}
387
 
.PP
388
 
Show all logs of the kernel device node
389
 
/dev/sda:
390
 
.sp
391
 
.if n \{\
392
 
.RS 4
393
 
.\}
394
 
.nf
395
 
journalctl /dev/sda
396
 
.fi
397
 
.if n \{\
398
 
.RE
399
 
.\}
400
 
.SH "SEE ALSO"
401
 
.PP
402
 
 
403
 
\fBsystemd\fR(1),
404
 
\fBsystemd-journald.service\fR(8),
405
 
\fBsystemctl\fR(1),
406
 
\fBsystemd.journal-fields\fR(7),
407
 
\fBjournald.conf\fR(5)
408
 
.SH "NOTES"
409
 
.IP " 1." 4
410
 
Journal Export Format
411
 
.RS 4
412
 
\%http://www.freedesktop.org/wiki/Software/systemd/export
413
 
.RE
414
 
.IP " 2." 4
415
 
Journal JSON Format
416
 
.RS 4
417
 
\%http://www.freedesktop.org/wiki/Software/systemd/json
418
 
.RE
419
 
.IP " 3." 4
420
 
Server-Sent Events
421
 
.RS 4
422
 
\%https://developer.mozilla.org/en-US/docs/Server-sent_events/Using_server-sent_events
423
 
.RE
424
 
.IP " 4." 4
425
 
Message Catalog Developer Documentation
426
 
.RS 4
427
 
\%http://www.freedesktop.org/wiki/Software/systemd/catalog
428
 
.RE