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">
6 This file is part of systemd.
8 Copyright 2012 Lennart Poettering
10 systemd is free software; you can redistribute it and/or modify it
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
13 (at your option) any later version.
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
18 Lesser General Public License for more details.
20 You should have received a copy of the GNU Lesser General Public License
21 along with systemd; If not, see <http://www.gnu.org/licenses/>.
24 <refentry id="journalctl">
27 <title>journalctl</title>
28 <productname>systemd</productname>
32 <contrib>Developer</contrib>
33 <firstname>Lennart</firstname>
34 <surname>Poettering</surname>
35 <email>lennart@poettering.net</email>
41 <refentrytitle>journalctl</refentrytitle>
42 <manvolnum>1</manvolnum>
46 <refname>journalctl</refname>
47 <refpurpose>Query the systemd journal</refpurpose>
52 <command>journalctl <arg choice="opt" rep="repeat">OPTIONS</arg> <arg choice="opt">MATCH</arg></command>
57 <title>Description</title>
59 <para><command>journalctl</command> may be
60 used to query the contents of the
61 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>
64 <para>If called without parameter will show the full
65 contents of the journal, starting with the oldest
66 entry collected.</para>
68 <para>If a match argument is passed the output is
69 filtered accordingly. A match is in the format
70 <literal>FIELD=VALUE</literal>,
71 e.g. <literal>_SYSTEMD_UNIT=httpd.service</literal>. See
72 <citerefentry><refentrytitle>systemd.journal-fields</refentrytitle><manvolnum>7</manvolnum></citerefentry>
73 for a list of well-known fields.</para>
75 <para>Output is interleaved from all accessible
76 journal files, whether they are rotated or currently
77 being written, and regardless whether they belong to the
78 system itself or are accessible user journals.</para>
80 <para>All users are granted access to their private
81 per-user journals. However, by default only root and
82 users who are members of the <literal>adm</literal>
83 group get access to the system journal and the
84 journals of other users.</para>
88 <title>Options</title>
90 <para>The following options are understood:</para>
94 <term><option>--help</option></term>
95 <term><option>-h</option></term>
97 <listitem><para>Prints a short help
98 text and exits.</para></listitem>
102 <term><option>--version</option></term>
104 <listitem><para>Prints a short version
105 string and exits.</para></listitem>
109 <term><option>--no-pager</option></term>
111 <listitem><para>Do not pipe output into a
112 pager.</para></listitem>
116 <term><option>--all</option></term>
117 <term><option>-a</option></term>
119 <listitem><para>Show all fields in
120 full, even if they include unprintable
121 characters or are very
122 long.</para></listitem>
126 <term><option>--follow</option></term>
127 <term><option>-f</option></term>
129 <listitem><para>Show only most recent
130 journal entries, and continously print
131 new entries as they are appended to
132 the journal.</para></listitem>
136 <term><option>--lines=</option></term>
137 <term><option>-n</option></term>
139 <listitem><para>Controls the number of
140 journal lines to show, counting from
141 the most recent ones. Takes a positive
142 integer argument. In follow mode
143 defaults to 10, otherwise is unset
144 thus not limiting how many lines are
145 shown.</para></listitem>
149 <term><option>--no-tail</option></term>
151 <listitem><para>Show all stored output
152 lines, even in follow mode. Undoes the
154 <option>--lines=</option>.</para></listitem>
158 <term><option>--output=</option></term>
159 <term><option>-o</option></term>
161 <listitem><para>Controls the
162 formatting of the journal entries that are
164 <literal>short</literal>,
165 <literal>short-monotonic</literal>,
166 <literal>verbose</literal>,
167 <literal>export</literal>,
168 <literal>json</literal>,
169 <literal>cat</literal>. <literal>short</literal>
170 is the default and generates an output
171 that is mostly identical to the
172 formatting of classic syslog log
173 files, showing one line per journal
174 entry. <literal>short-monotonic</literal>
175 is very similar but shows monotonic
176 timestamps instead of wallclock
177 timestamps. <literal>verbose</literal>
178 shows the full structered entry items
180 fiels. <literal>export</literal>
181 serializes the journal into a binary
182 (but mostly text-based) stream
183 suitable for backups and network
184 transfer. <literal>json</literal>
185 formats entries as JSON data
186 structures. <literal>cat</literal>
187 generates a very terse output only
188 showing the actual message of each
189 journal entry with no meta data, not
190 even a timestamp.</para></listitem>
194 <term><option>--quiet</option></term>
195 <term><option>-q</option></term>
197 <listitem><para>Suppresses any warning
198 message regarding inaccessable system
199 journals when run as normal
200 user.</para></listitem>
204 <term><option>--local</option></term>
205 <term><option>-l</option></term>
207 <listitem><para>Show only locally
208 generated messages.</para></listitem>
212 <term><option>--new-id128</option></term>
214 <listitem><para>Instead of showing
215 journal contents generate a new 128
216 bit ID suitable for identifying
217 messages. This is intended for usage
218 by developers who need a new
219 identifier for a new message they
220 introduce and want to make
221 recognizable. Will print the new ID in
222 three different formats which can be
223 copied into source code or
224 similar.</para></listitem>
231 <title>Exit status</title>
233 <para>On success 0 is returned, a non-zero failure
234 code otherwise.</para>
238 <title>Environment</title>
242 <term><varname>$SYSTEMD_PAGER</varname></term>
243 <listitem><para>Pager to use when
244 <option>--no-pager</option> is not given;
245 overrides <varname>$PAGER</varname>. Setting
246 this to an empty string or the value
247 <literal>cat</literal> is equivalent to passing
248 <option>--no-pager</option>.</para></listitem>
254 <title>See Also</title>
256 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
257 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
258 <citerefentry><refentrytitle>systemd.journal-fields</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
259 <citerefentry><refentrytitle>journald.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>