journalctl.xml revision 21ac6ff143cc8bebfbd1818af28e8c6f82cd5265
9661674ed58ba62a40e43d1a4b38d5e77c3c6545Knut Anders Hatlen<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
9661674ed58ba62a40e43d1a4b38d5e77c3c6545Knut Anders Hatlen "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
9661674ed58ba62a40e43d1a4b38d5e77c3c6545Knut Anders Hatlen This file is part of systemd.
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye Copyright 2012 Lennart Poettering
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye systemd is free software; you can redistribute it and/or modify it
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye under the terms of the GNU Lesser General Public License as published by
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye the Free Software Foundation; either version 2.1 of the License, or
bcae302a5f4b516d2f3c05f657df054e1a0efde7Knut Anders Hatlen (at your option) any later version.
98774b0b90e4da0f3f2c5e4856bcbbf366ed0fe0Knut Anders Hatlen systemd is distributed in the hope that it will be useful, but
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye WITHOUT ANY WARRANTY; without even the implied warranty of
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye Lesser General Public License for more details.
afb218f076cae538126a5f931299a82a114a075aKnut Anders Hatlen You should have received a copy of the GNU Lesser General Public License
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye along with systemd; If not, see <http://www.gnu.org/licenses/>.
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye <refentryinfo>
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye </authorgroup>
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye </refentryinfo>
bbb39d08c0e5b73c89ba813a7c1789842c60f961Lubos Kosco <refnamediv>
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye <refpurpose>Query the systemd journal</refpurpose>
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye </refnamediv>
b645988bdc1cf4f2f82b8c00ed041ddddd822c24Lubos Kosco <refsynopsisdiv>
b645988bdc1cf4f2f82b8c00ed041ddddd822c24Lubos Kosco <cmdsynopsis>
ca37bb3c4127b35d333203398bd983ee730d9da5Jan S Berg </cmdsynopsis>
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye </refsynopsisdiv>
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye <para><command>journalctl</command> may be used to
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye query the contents of the
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>
4bb936310d8f131aa850821e9254ac14242c7f95Knut Anders Hatlen journal as written by
4bb936310d8f131aa850821e9254ac14242c7f95Knut Anders Hatlen <citerefentry><refentrytitle>systemd-journald.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye <para>If called without parameters, it will show the full
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye contents of the journal, starting with the oldest
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye entry collected.</para>
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye <para>If one or more match arguments are passed, the
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye output is filtered accordingly. A match is in the
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye e.g. <literal>_SYSTEMD_UNIT=httpd.service</literal>,
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye referring to the components of a structured journal
87396bac3204b6788c817e19222626eefde8f3f0Knut Anders Hatlen <citerefentry><refentrytitle>systemd.journal-fields</refentrytitle><manvolnum>7</manvolnum></citerefentry>
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye for a list of well-known fields. If multiple matches
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye are specified matching different fields, the log
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye entries are filtered by both, i.e. the resulting output
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye will show only entries matching all the specified
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye matches of this kind. If two matches apply to the same
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye field, then they are automatically matched as
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye alternatives, i.e. the resulting output will show
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye entries matching any of the specified matches for the
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye same field. Finally, if the character
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye <literal>+</literal> appears as a separate word on the
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye command line, all matches before and after are combined
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye <para>As shortcuts for a few types of field/value
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye matches, file paths may be specified. If a file path
8d5c49b3d8edaa0069e4f802cf8bd70af9994c35Knut Anders Hatlen refers to an executable file, this is equivalent to an
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye <literal>_EXE=</literal> match for the canonicalized
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye binary path. Similarly, if a path refers to a device
25fddb6fbc2130e3847315ff2b0b6819ff3feccaLubos Kosco node, this is equivalent to a
25fddb6fbc2130e3847315ff2b0b6819ff3feccaLubos Kosco <literal>_KERNEL_DEVICE=</literal> match for the
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye device.</para>
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye <para>Output is interleaved from all accessible
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye journal files, whether they are rotated or currently
url="http://www.freedesktop.org/wiki/Software/systemd/export">Journal
url="http://www.freedesktop.org/wiki/Software/systemd/json">Journal
url="https://developer.mozilla.org/en-US/docs/Server-sent_events/Using_server-sent_events">Server-Sent
url="http://www.freedesktop.org/wiki/Software/systemd/catalog">Message
<term><option>-b <optional><replaceable>ID</replaceable></optional><optional><replaceable>±offset</replaceable></optional></option></term>
<term><option>--boot=<optional><replaceable>ID</replaceable></optional><optional><replaceable>±offset</replaceable></optional></option></term>
<term><option>--unit=<replaceable>UNIT</replaceable>|<replaceable>PATTERN</replaceable></option></term>
or textual log level (i.e. between
the form FROM..TO. The log levels are
<para>If two different fields are matched, only entries matching both expressions at the same time are shown:</para>
<para>If two matches refer to the same field, all entries matching either expression are shown:</para>
<programlisting>journalctl _SYSTEMD_UNIT=avahi-daemon.service _SYSTEMD_UNIT=dbus.service</programlisting>
<programlisting>journalctl _SYSTEMD_UNIT=avahi-daemon.service _PID=28097 + _SYSTEMD_UNIT=dbus.service</programlisting>
<citerefentry><refentrytitle>systemd-journald.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>systemd.journal-fields</refentrytitle><manvolnum>7</manvolnum></citerefentry>,