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 General Public License as published by
12 the Free Software Foundation; either version 2 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 General Public License for more details.
20 You should have received a copy of the GNU 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 <refname>systemd-journalctl</refname>
48 <refpurpose>Query the systemd journal</refpurpose>
53 <command>journalctl <arg choice="opt" rep="repeat">OPTIONS</arg> <arg choice="opt">MATCH</arg></command>
58 <title>Description</title>
60 <para><command>journalctl</command> may be
61 used to query the contents of the
62 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>
65 <para>If called without parameter will show the full
66 contents of the journal, starting with the oldest
67 entry collected.</para>
69 <para>If a match argument is passed the output is
70 filtered accordingly. A match is in the format
71 <literal>FIELD=VALUE</literal>,
72 e.g. <literal>_SYSTEMD_UNIT=httpd.service</literal>.</para>
74 <para>Output is interleaved from all accessible
75 journal files, whether they are rotated or currently
76 being written, and regardless whether they belong to the
77 system itself or are accessible user journals.</para>
79 <para>All users are granted access to their private
80 per-user journals. However, by default only root and
81 users who are members of the <literal>adm</literal>
82 group get access to the system journal and the
83 journals of other users.</para>
87 <title>Options</title>
89 <para>The following options are understood:</para>
93 <term><option>--help</option></term>
94 <term><option>-h</option></term>
96 <listitem><para>Prints a short help
97 text and exits.</para></listitem>
101 <term><option>--version</option></term>
103 <listitem><para>Prints a short version
104 string and exits.</para></listitem>
108 <term><option>--no-pager</option></term>
110 <listitem><para>Do not pipe output into a
111 pager.</para></listitem>
115 <term><option>--all</option></term>
116 <term><option>-a</option></term>
118 <listitem><para>Show all fields in
119 full, even if they include unprintable
120 characters or are very
121 long.</para></listitem>
125 <term><option>--follow</option></term>
126 <term><option>-f</option></term>
128 <listitem><para>Show only most recent
129 journal entries, and continously print
130 new entries as they are appended to
131 the journal.</para></listitem>
135 <term><option>--lines=</option></term>
136 <term><option>-n</option></term>
138 <listitem><para>Controls the number of
139 journal lines to show, counting from
140 the most recent ones. Takes a positive
141 integer argument. In follow mode
142 defaults to 10, otherwise is unset
143 thus not limiting how many lines are
144 shown.</para></listitem>
148 <term><option>--no-tail</option></term>
150 <listitem><para>Show all stored output
151 lines, even in follow mode. Undoes the
153 <option>--lines=</option>.</para></listitem>
157 <term><option>--output=</option></term>
158 <term><option>-o</option></term>
160 <listitem><para>Controls the
161 formatting of the journal entries that are
163 <literal>short</literal>,
164 <literal>short-monotonic</literal>,
165 <literal>verbose</literal>,
166 <literal>export</literal>,
167 <literal>json</literal>,
168 <literal>cat</literal>. <literal>short</literal>
169 is the default and generates an output
170 that is mostly identical to the
171 formatting of classic syslog log
172 files, showing one line per journal
173 entry. <literal>short-monotonic</literal>
174 is very similar but shows monotonic
175 timestamps instead of wallclock
176 timestamps. <literal>verbose</literal>
177 shows the full structered entry items
179 fiels. <literal>export</literal>
180 serializes the journal into a binary
181 (but mostly text-based) stream
182 suitable for backups and network
183 transfer. <literal>json</literal>
184 formats entries as JSON data
185 structures. <literal>cat</literal>
186 generates a very terse output only
187 showing the actual message of each
188 journal entry with no meta data, not
189 even a timestamp.</para></listitem>
193 <term><option>--quiet</option></term>
194 <term><option>-q</option></term>
196 <listitem><para>Suppresses any warning
197 message regarding inaccessable system
198 journals when run as normal
199 user.</para></listitem>
203 <term><option>--local</option></term>
204 <term><option>-l</option></term>
206 <listitem><para>Show only locally
207 generated messages.</para></listitem>
211 <term><option>--new-id128</option></term>
213 <listitem><para>Instead of showing
214 journal contents generate a new 128
215 bit ID suitable for identifying
216 messages. This is intended for usage
217 by developers who need a new
218 identifier for a new message they
219 introduce and want to make
220 recognizable. Will print the new ID in
221 three different formats which can be
222 copied into source code or
223 similar.</para></listitem>
230 <title>Exit status</title>
232 <para>On success 0 is returned, a non-zero failure
233 code otherwise.</para>
237 <title>Environment</title>
241 <term><varname>$SYSTEMD_PAGER</varname></term>
242 <listitem><para>Pager to use when
243 <option>--no-pager</option> is not given;
244 overrides <varname>$PAGER</varname>. Setting
245 this to an empty string or the value
246 <literal>cat</literal> is equivalent to passing
247 <option>--no-pager</option>.</para></listitem>
253 <title>See Also</title>
255 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
256 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
257 <citerefentry><refentrytitle>systemd-journald.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>