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 Zbigniew Jędrzejewski-Szmek
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="systemd-journal-gatewayd.service">
27 <title>systemd-journal-gatewayd.service</title>
28 <productname>systemd</productname>
32 <contrib>Developer</contrib>
33 <firstname>Zbigniew</firstname>
34 <surname>Jędrzejewski-Szmek</surname>
35 <email>zbyszek@in.waw.pl</email>
41 <refentrytitle>systemd-journal-gatewayd.service</refentrytitle>
42 <manvolnum>8</manvolnum>
46 <refname>systemd-journal-gatewayd.service</refname>
47 <refname>systemd-journal-gatewayd.socket</refname>
48 <refname>systemd-journal-gatewayd</refname>
49 <refpurpose>HTTP server for journal events</refpurpose>
53 <para><filename>systemd-journal-gatewayd.service</filename></para>
54 <para><filename>systemd-journal-gatewayd.socket</filename></para>
55 <cmdsynopsis><command>/usr/lib/systemd/systemd-journal-gatewayd</command>
60 <title>Description</title>
62 <para><command>systemd-journal-gatewayd</command> serves journal
63 events over the network. Clients must connect using
64 HTTP, to port 19531 by default.</para>
66 <para>The program is started by
67 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>
68 and expects to receive a single socket. Use
69 <command>systemctl start systemd-journal-gatewayd.socket</command> to start
70 the service, and <command>systemctl enable systemd-journal-gatewayd.socket</command>
71 to have it started on boot.</para>
75 <title>Supported URLs</title>
77 <para>The following URLs are recognized:</para>
81 <term><option>/browse</option></term>
83 <listitem><para>Interactive browsing.</para></listitem>
87 <term><option>/entries[?option1&option2=value...]</option></term>
89 <listitem><para>Retrieval of events in various formats.</para>
91 <para>The <option>Accept:</option> part of the HTTP header
92 determines the format. Supported values are described below.
95 <para>The <option>Range:</option> part of the HTTP header
96 determines the range of events returned. Supported values are
100 <para>GET parameters can be used to modify what events are
101 returned. Supported parameters are described below.</para>
108 <title>Accept header</title>
111 <option>Accept: <format></option>
114 <para>Recognized formats:</para>
118 <term><option>text/plain</option></term>
120 <listitem><para>The default. Plaintext syslog-like output,
121 one line per journal entry
122 (like <command>journalctl --output short</command>).</para>
127 <term><option>application/json</option></term>
129 <listitem><para>Entries are formatted as JSON data structures,
131 (like <command>journalctl --output json</command>).
133 url="http://www.freedesktop.org/wiki/Software/systemd/json">Journal
134 JSON Format</ulink> for more information.</para>
139 <term><option>application/event-stream</option></term>
141 <listitem><para>Entries are formatted as JSON data structures,
142 wrapped in a format suitable for <ulink
143 url="https://developer.mozilla.org/en-US/docs/Server-sent_events/Using_server-sent_events">
144 Server-Sent Events</ulink>
145 (like <command>journalctl --output json-sse</command>).
151 <term><option>application/vnd.fdo.journal</option></term>
153 <listitem><para>Entries are serialized into a binary (but
154 mostly text-based) stream suitable for backups and network
156 (like <command>journalctl --output export</command>).
158 url="http://www.freedesktop.org/wiki/Software/systemd/export">Journal
159 Export Format</ulink> for more information.</para>
166 <title>Range header</title>
169 <option>Range: entries=<cursor>[[:<num_skip>]:<num_entries>]</option>
173 <option>cursor</option> is a cursor string,
174 <option>num_skip</option> is an integer,
175 <option>num_entries</option> is an unsigned integer.
178 <para>Range defaults to all available events.</para>
182 <title>URL GET parameters</title>
184 <para>Following parameters can be used as part of the URL:</para>
188 <term><option>follow</option></term>
190 <listitem><para>wait for new events
191 (like <command>journalctl --follow</command>, except that
192 the number of events returned is not limited).</para>
197 <term><option>discrete</option></term>
199 <listitem><para>Test that the specified cursor refers to an
200 entry in the journal. Returns just this entry.</para>
205 <term><option>boot</option></term>
207 <listitem><para>Limit events to the current boot of the system
208 (like <command>journalctl --this--boot</command>).</para></listitem>
212 <term><option><KEY>=<match></option></term>
214 <listitem><para>Match journal fields. See
215 <citerefentry><refentrytitle>systemd.journal-fields</refentrytitle><manvolnum>7</manvolnum></citerefentry>.</para>
222 <title>Examples</title>
223 <para>Retrieve events from this boot from local journal
225 url="http://www.freedesktop.org/wiki/Software/systemd/export">Journal
226 Export Format</ulink>:
228 curl --silent -H'Accept: application/vnd.fdo.journal' \
229 'http://localhost:19531/entries?boot'
233 <para>Listen for core dumps:
235 curl 'http://localhost:19531/entries?follow&MESSAGE_ID=fc2e22bc6ee647b6b90729ab34a250b1'
236 </programlisting></para>
240 <title>See Also</title>
242 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
243 <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
244 <citerefentry><refentrytitle>systemd-journald.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
245 <citerefentry><refentrytitle>systemd.journal-fields</refentrytitle><manvolnum>7</manvolnum></citerefentry>,