systemd/man/journalctl.html
Michael Stapelberg ba573a3afc Use orig tarball systemd-204.tar.xz.
Instead of tracking git upstream directly, the upstream branch now
contains the contents of the orig tarball available at
http://www.freedesktop.org/software/systemd/
2014-04-26 10:16:11 +02:00

334 lines
32 KiB
HTML

<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>journalctl</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><style>
a.headerlink {
color: #c60f0f;
font-size: 0.8em;
padding: 0 4px 0 4px;
text-decoration: none;
visibility: hidden;
}
a.headerlink:hover {
background-color: #c60f0f;
color: white;
}
h1:hover > a.headerlink, h2:hover > a.headerlink, h3:hover > a.headerlink, dt:hover > a.headerlink {
visibility: visible;
}
</style><a href="index.html">Index </a>·
<a href="systemd.directives.html">Directives </a>·
<a href="../python-systemd/index.html">Python </a>·
<a href="../libudev/index.html">libudev </a>·
<a href="../libudev/index.html">gudev </a><span style="float:right">systemd 204</span><hr><div class="refentry"><a name="journalctl"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>journalctl — Query the systemd journal</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">journalctl</code> [OPTIONS...] [MATCHES...]</p></div></div><div class="refsect1"><a name="idm259766678784"></a><h2 id="Description">Description<a class="headerlink" title="Permalink to this headline" href="#Description"></a></h2><p><span class="command"><strong>journalctl</strong></span> may be used to
query the contents of the
<a href="systemd.html"><span class="citerefentry"><span class="refentrytitle">systemd</span>(1)</span></a>
journal as written by
<a href="systemd-journald.service.html"><span class="citerefentry"><span class="refentrytitle">systemd-journald.service</span>(8)</span></a>.</p><p>If called without parameter it will show the full
contents of the journal, starting with the oldest
entry collected.</p><p>If one or more match arguments are passed the
output is filtered accordingly. A match is in the
format <code class="literal">FIELD=VALUE</code>,
e.g. <code class="literal">_SYSTEMD_UNIT=httpd.service</code>,
referring to the components of a structured journal
entry. See
<a href="systemd.journal-fields.html"><span class="citerefentry"><span class="refentrytitle">systemd.journal-fields</span>(7)</span></a>
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
"<code class="literal">+</code>" appears as separate word on the
command line all matches before and after are combined
in a disjunction (i.e. logical OR).</p><p>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
<code class="literal">_EXE=</code> match for the canonicalized
binary path. Similar, if a path refers to a device
node, this is equivalent to a
<code class="literal">_KERNEL_DEVICE=</code> match for the
device.</p><p>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.</p><p>All users are granted access to their private
per-user journals. However, by default only root and
users who are members of the <code class="literal">adm</code>
group get access to the system journal and the
journals of other users.</p></div><div class="refsect1"><a name="idm259766666320"></a><h2 id="Options">Options<a class="headerlink" title="Permalink to this headline" href="#Options"></a></h2><p>The following options are understood:</p><div class="variablelist"><dl class="variablelist"><dt id="-h"><span class="term"><code class="option">-h</code>, </span><span class="term"><code class="option">--help</code></span><a class="headerlink" title="Permalink to this term" href="#-h"></a></dt><dd><p>Prints a short help
text and exits.</p></dd><dt id="--version"><span class="term"><code class="option">--version</code></span><a class="headerlink" title="Permalink to this term" href="#--version"></a></dt><dd><p>Prints a short version
string and exits.</p></dd><dt id="--no-pager"><span class="term"><code class="option">--no-pager</code></span><a class="headerlink" title="Permalink to this term" href="#--no-pager"></a></dt><dd><p>Do not pipe output into a
pager.</p></dd><dt id="--full"><span class="term"><code class="option">--full</code></span><a class="headerlink" title="Permalink to this term" href="#--full"></a></dt><dd><p>Show all (printable) fields in
full.</p></dd><dt id="-a"><span class="term"><code class="option">-a</code>, </span><span class="term"><code class="option">--all</code></span><a class="headerlink" title="Permalink to this term" href="#-a"></a></dt><dd><p>Show all fields in
full, even if they include unprintable
characters or are very
long.</p></dd><dt id="-f"><span class="term"><code class="option">-f</code>, </span><span class="term"><code class="option">--follow</code></span><a class="headerlink" title="Permalink to this term" href="#-f"></a></dt><dd><p>Show only the most recent
journal entries, and continuously print
new entries as they are appended to
the journal.</p></dd><dt id="-e"><span class="term"><code class="option">-e</code>, </span><span class="term"><code class="option">--pager-end</code></span><a class="headerlink" title="Permalink to this term" href="#-e"></a></dt><dd><p>Immediately jump to
the end of the journal inside the
implied pager tool. This implies
<code class="option">-n1000</code> to guarantee
that the pager won't buffer logs of
unbounded size. This may be overridden
with an explicit <code class="option">-n</code>
with some other numeric value on the
command line. Note that this option is
only supported for the
<a href="less.html"><span class="citerefentry"><span class="refentrytitle">less</span>(1)</span></a>
pager.</p></dd><dt id="-n"><span class="term"><code class="option">-n</code>, </span><span class="term"><code class="option">--lines=</code></span><a class="headerlink" title="Permalink to this term" href="#-n"></a></dt><dd><p>Show the most recent
journal events and limit the number of
events shown. If
<code class="option">--follow</code> is used,
this option is implied. The argument,
a positive integer, is optional, and
defaults to 10. </p></dd><dt id="--no-tail"><span class="term"><code class="option">--no-tail</code></span><a class="headerlink" title="Permalink to this term" href="#--no-tail"></a></dt><dd><p>Show all stored output
lines, even in follow mode. Undoes the
effect of
<code class="option">--lines=</code>.</p></dd><dt id="-r"><span class="term"><code class="option">-r</code>, </span><span class="term"><code class="option">--reverse</code></span><a class="headerlink" title="Permalink to this term" href="#-r"></a></dt><dd><p>Reverse output, so the newest
entries are displayed first.</p></dd><dt id="-o"><span class="term"><code class="option">-o</code>, </span><span class="term"><code class="option">--output=</code></span><a class="headerlink" title="Permalink to this term" href="#-o"></a></dt><dd><p>Controls the
formatting of the journal entries that
are shown. Takes one of
<code class="literal">short</code>,
<code class="literal">short-monotonic</code>,
<code class="literal">verbose</code>,
<code class="literal">export</code>,
<code class="literal">json</code>,
<code class="literal">json-pretty</code>,
<code class="literal">json-sse</code>,
<code class="literal">cat</code>. <code class="literal">short</code>
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. <code class="literal">short-monotonic</code>
is very similar but shows monotonic
timestamps instead of wallclock
timestamps. <code class="literal">verbose</code>
shows the full structured entry items
with all
fields. <code class="literal">export</code>
serializes the journal into a binary
(but mostly text-based) stream
suitable for backups and network
transfer (see <a class="ulink" href="http://www.freedesktop.org/wiki/Software/systemd/export" target="_top">Journal
Export Format</a> for more
information). <code class="literal">json</code>
formats entries as JSON data
structures, one per
line (see <a class="ulink" href="http://www.freedesktop.org/wiki/Software/systemd/json" target="_top">Journal
JSON Format</a> for more
information). <code class="literal">json-pretty</code>
also formats entries as JSON data
structures, but formats them in
multiple lines in order to make them
more readable for
humans. <code class="literal">json-sse</code>
also formats entries as JSON data
structures, but wraps them in a format
suitable for <a class="ulink" href="https://developer.mozilla.org/en-US/docs/Server-sent_events/Using_server-sent_events" target="_top">Server-Sent
Events</a>. <code class="literal">cat</code>
generates a very terse output only
showing the actual message of each
journal entry with no meta data, not
even a timestamp.</p></dd><dt id="-x"><span class="term"><code class="option">-x</code>, </span><span class="term"><code class="option">--catalog</code></span><a class="headerlink" title="Permalink to this term" href="#-x"></a></dt><dd><p>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 <a class="ulink" href="http://www.freedesktop.org/wiki/Software/systemd/catalog" target="_top">Message
Catalog Developer
Documentation</a>.</p></dd><dt id="-q"><span class="term"><code class="option">-q</code>, </span><span class="term"><code class="option">--quiet</code></span><a class="headerlink" title="Permalink to this term" href="#-q"></a></dt><dd><p>Suppresses any warning
message regarding inaccessible system
journals when run as normal
user.</p></dd><dt id="-m"><span class="term"><code class="option">-m</code>, </span><span class="term"><code class="option">--merge</code></span><a class="headerlink" title="Permalink to this term" href="#-m"></a></dt><dd><p>Show entries
interleaved from all available
journals, including remote
ones.</p></dd><dt id="-b"><span class="term"><code class="option">-b</code>, </span><span class="term"><code class="option">--this-boot</code></span><a class="headerlink" title="Permalink to this term" href="#-b"></a></dt><dd><p>Show data only from
current boot. This will add a match
for <code class="literal">_BOOT_ID=</code> for
the current boot ID of the
kernel.</p></dd><dt id="-u"><span class="term"><code class="option">-u</code>, </span><span class="term"><code class="option">--unit=</code></span><a class="headerlink" title="Permalink to this term" href="#-u"></a></dt><dd><p>Show messages for the
specified systemd unit. This will add
a match for messages from the unit
(<code class="literal">_SYSTEMD_UNIT=</code>)
and additional matches for messages
from systemd and messages about
coredumps for the specified unit.</p><p>This parameter can be specified multiple times.
</p></dd><dt id="--user-unit="><span class="term"><code class="option">--user-unit=</code></span><a class="headerlink" title="Permalink to this term" href="#--user-unit="></a></dt><dd><p>Show messages for the
specified user session unit. This will
add a match for messages from the unit
(<code class="literal">_SYSTEMD_USER_UNIT=</code>
and <code class="literal">_UID=</code>) and
additional matches for messages from
session systemd and messages about
coredumps for the specified unit.</p><p>This parameter can be specified multiple times.
</p></dd><dt id="-p"><span class="term"><code class="option">-p</code>, </span><span class="term"><code class="option">--priority=</code></span><a class="headerlink" title="Permalink to this term" href="#-p"></a></dt><dd><p>Filter output by
message priorities or priority
ranges. Takes either a single numeric
or textual log level (i.e. between
0/<code class="literal">emerg</code> and
7/<code class="literal">debug</code>), 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
<a href="syslog.html"><span class="citerefentry"><span class="refentrytitle">syslog</span>(3)</span></a>,
i.e. <code class="literal">emerg</code> (0),
<code class="literal">alert</code> (1),
<code class="literal">crit</code> (2),
<code class="literal">err</code> (3),
<code class="literal">warning</code> (4),
<code class="literal">notice</code> (5),
<code class="literal">info</code> (6),
<code class="literal">debug</code> (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
<code class="literal">PRIORITY=</code> matches
for the specified
priorities.</p></dd><dt id="-c"><span class="term"><code class="option">-c</code>, </span><span class="term"><code class="option">--cursor=</code></span><a class="headerlink" title="Permalink to this term" href="#-c"></a></dt><dd><p>Start showing entries
from the location in the journal
specified by the passed
cursor.</p></dd><dt id="--since="><span class="term"><code class="option">--since=</code>, </span><span class="term"><code class="option">--until=</code></span><a class="headerlink" title="Permalink to this term" href="#--since="></a></dt><dd><p>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
<code class="literal">yesterday</code>,
<code class="literal">today</code>,
<code class="literal">tomorrow</code> 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. <code class="literal">now</code>
refers to the current time. Finally,
relative times may be specified,
prefixed with <code class="literal">-</code> or
<code class="literal">+</code>, referring to
times before or after the current
time, respectively.</p></dd><dt id="-F"><span class="term"><code class="option">-F</code>, </span><span class="term"><code class="option">--field=</code></span><a class="headerlink" title="Permalink to this term" href="#-F"></a></dt><dd><p>Print all possible
data values the specified field can
take in all entries of the
journal.</p></dd><dt id="-D"><span class="term"><code class="option">-D</code>, </span><span class="term"><code class="option">--directory=</code></span><a class="headerlink" title="Permalink to this term" href="#-D"></a></dt><dd><p>Takes a
directory path as argument. If
specified journalctl will operate on the
specified journal directory instead of
the default runtime and system journal
paths.</p></dd><dt id="--root=ROOT"><span class="term"><code class="option">--root=<em class="replaceable"><code>ROOT</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--root=ROOT"></a></dt><dd><p>Takes a directory path
as argument. If specified journalctl
will operate on catalog file hierarchy
underneath the specified directory
instead of the root directory
(e.g. <code class="option">--update-catalog</code>
will create
<code class="filename"><em class="replaceable"><code>ROOT</code></em>/var/lib/systemd/catalog/database</code>).
</p></dd><dt id="--new-id128"><span class="term"><code class="option">--new-id128</code></span><a class="headerlink" title="Permalink to this term" href="#--new-id128"></a></dt><dd><p>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.</p></dd><dt id="--header"><span class="term"><code class="option">--header</code></span><a class="headerlink" title="Permalink to this term" href="#--header"></a></dt><dd><p>Instead of showing
journal contents show internal header
information of the journal fields
accessed.</p></dd><dt id="--disk-usage"><span class="term"><code class="option">--disk-usage</code></span><a class="headerlink" title="Permalink to this term" href="#--disk-usage"></a></dt><dd><p>Shows the current disk
usage of all
journal files.</p></dd><dt id="--list-catalog
ID128...
"><span class="term"><code class="option">--list-catalog
[<span class="optional"><em class="replaceable"><code>ID128...</code></em></span>]
</code></span><a class="headerlink" title="Permalink to this term" href="#--list-catalog%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ID128...%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20"></a></dt><dd><p>List the contents of
the message catalog, as table of
message IDs plus their short
description strings.</p><p>If any
<em class="replaceable"><code>ID128</code></em>s are
specified, only those entries are shown.
</p></dd><dt id="--dump-catalog
ID128...
"><span class="term"><code class="option">--dump-catalog
[<span class="optional"><em class="replaceable"><code>ID128...</code></em></span>]
</code></span><a class="headerlink" title="Permalink to this term" href="#--dump-catalog%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ID128...%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20"></a></dt><dd><p>Show the contents of
the message catalog, with entries
separated by a line consisting of two
dashes and the id (the format is the
same as <code class="filename">.catalog</code>
files.</p><p>If any
<em class="replaceable"><code>ID128</code></em>s are
specified, only those entries are shown.
</p></dd><dt id="--update-catalog"><span class="term"><code class="option">--update-catalog</code></span><a class="headerlink" title="Permalink to this term" href="#--update-catalog"></a></dt><dd><p>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.</p></dd><dt id="--setup-keys"><span class="term"><code class="option">--setup-keys</code></span><a class="headerlink" title="Permalink to this term" href="#--setup-keys"></a></dt><dd><p>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.</p></dd><dt id="--interval="><span class="term"><code class="option">--interval=</code></span><a class="headerlink" title="Permalink to this term" href="#--interval="></a></dt><dd><p>Specifies the change
interval for the sealing key, when
generating an FSS key pair with
<code class="option">--setup-keys</code>. Shorter
intervals increase CPU consumption but
shorten the time range of
undetectable journal
alterations. Defaults to
15min.</p></dd><dt id="--verify"><span class="term"><code class="option">--verify</code></span><a class="headerlink" title="Permalink to this term" href="#--verify"></a></dt><dd><p>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
<code class="option">--verify-key=</code>
authenticity of the journal file is
verified.</p></dd><dt id="--verify-key="><span class="term"><code class="option">--verify-key=</code></span><a class="headerlink" title="Permalink to this term" href="#--verify-key="></a></dt><dd><p>Specifies the FSS
verification key to use for the
<code class="option">--verify</code>
operation.</p></dd></dl></div></div><div class="refsect1"><a name="idm259765527728"></a><h2 id="Exit status">Exit status<a class="headerlink" title="Permalink to this headline" href="#Exit%20status"></a></h2><p>On success 0 is returned, a non-zero failure
code otherwise.</p></div><div class="refsect1"><a name="idm259765526480"></a><h2 id="Environment">Environment<a class="headerlink" title="Permalink to this headline" href="#Environment"></a></h2><div class="variablelist"><dl class="variablelist"><dt id="$SYSTEMD_PAGER"><span class="term"><code class="varname">$SYSTEMD_PAGER</code></span><a class="headerlink" title="Permalink to this term" href="#%24SYSTEMD_PAGER"></a></dt><dd><p>Pager to use when
<code class="option">--no-pager</code> is not given;
overrides <code class="varname">$PAGER</code>. Setting
this to an empty string or the value
<code class="literal">cat</code> is equivalent to passing
<code class="option">--no-pager</code>.</p></dd></dl></div></div><div class="refsect1"><a name="idm259765521696"></a><h2 id="Examples">Examples<a class="headerlink" title="Permalink to this headline" href="#Examples"></a></h2><p>Without arguments all collected logs are shown
unfiltered:</p><pre class="programlisting">journalctl</pre><p>With one match specified all entries with a field matching the expression are shown:</p><pre class="programlisting">journalctl _SYSTEMD_UNIT=avahi-daemon.service</pre><p>If two different fields are matched only entries matching both expressions at the same time are shown:</p><pre class="programlisting">journalctl _SYSTEMD_UNIT=avahi-daemon.service _PID=28097</pre><p>If two matches refer to the same field all entries matching either expression are shown:</p><pre class="programlisting">journalctl _SYSTEMD_UNIT=avahi-daemon.service _SYSTEMD_UNIT=dbus.service</pre><p>If the separator "<code class="literal">+</code>" 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):</p><pre class="programlisting">journalctl _SYSTEMD_UNIT=avahi-daemon.service _PID=28097 + _SYSTEMD_UNIT=dbus.service</pre><p>Show all logs generated by the D-Bus executable:</p><pre class="programlisting">journalctl /usr/bin/dbus-daemon</pre><p>Show all logs of the kernel device node <code class="filename">/dev/sda</code>:</p><pre class="programlisting">journalctl /dev/sda</pre></div><div class="refsect1"><a name="idm259765511392"></a><h2 id="See Also">See Also<a class="headerlink" title="Permalink to this headline" href="#See%20Also"></a></h2><p>
<a href="systemd.html"><span class="citerefentry"><span class="refentrytitle">systemd</span>(1)</span></a>,
<a href="systemd-journald.service.html"><span class="citerefentry"><span class="refentrytitle">systemd-journald.service</span>(8)</span></a>,
<a href="systemctl.html"><span class="citerefentry"><span class="refentrytitle">systemctl</span>(1)</span></a>,
<a href="systemd.journal-fields.html"><span class="citerefentry"><span class="refentrytitle">systemd.journal-fields</span>(7)</span></a>,
<a href="journald.conf.html"><span class="citerefentry"><span class="refentrytitle">journald.conf</span>(5)</span></a>
</p></div></div></body></html>