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. The server listens on 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>
106 <term><option>/machine</option></term>
108 <listitem><para>Return a JSON structure describing the machine.</para>
112 { "machine_id" : "8cf7ed9d451ea194b77a9f118f3dc446",
113 "boot_id" : "3d3c9efaf556496a9b04259ee35df7f7",
114 "hostname" : "fedora",
115 "os_pretty_name" : "Fedora 19 (Rawhide)",
116 "virtualization" : "kvm",
124 <term><option>/fields/</option><replaceable>FIELD_NAME</replaceable></term>
126 <listitem><para>Return a list of values of this field present in the logs.</para>
133 <title>Accept header</title>
136 <option>Accept: </option><replaceable>format</replaceable>
139 <para>Recognized formats:</para>
143 <term><option>text/plain</option></term>
145 <listitem><para>The default. Plaintext syslog-like output,
146 one line per journal entry
147 (like <command>journalctl --output short</command>).</para>
152 <term><option>application/json</option></term>
154 <listitem><para>Entries are formatted as JSON data structures,
156 (like <command>journalctl --output json</command>).
158 url="http://www.freedesktop.org/wiki/Software/systemd/json">Journal
159 JSON Format</ulink> for more information.</para>
164 <term><option>application/event-stream</option></term>
166 <listitem><para>Entries are formatted as JSON data structures,
167 wrapped in a format suitable for <ulink
168 url="https://developer.mozilla.org/en-US/docs/Server-sent_events/Using_server-sent_events">
169 Server-Sent Events</ulink>
170 (like <command>journalctl --output json-sse</command>).
176 <term><option>application/vnd.fdo.journal</option></term>
178 <listitem><para>Entries are serialized into a binary (but
179 mostly text-based) stream suitable for backups and network
181 (like <command>journalctl --output export</command>).
183 url="http://www.freedesktop.org/wiki/Software/systemd/export">Journal
184 Export Format</ulink> for more information.</para>
191 <title>Range header</title>
194 <option>Range: entries=<cursor>[[:<num_skip>]:<num_entries>]</option>
198 <option>cursor</option> is a cursor string,
199 <option>num_skip</option> is an integer,
200 <option>num_entries</option> is an unsigned integer.
203 <para>Range defaults to all available events.</para>
207 <title>URL GET parameters</title>
209 <para>Following parameters can be used as part of the URL:</para>
213 <term><option>follow</option></term>
215 <listitem><para>wait for new events
216 (like <command>journalctl --follow</command>, except that
217 the number of events returned is not limited).</para>
222 <term><option>discrete</option></term>
224 <listitem><para>Test that the specified cursor refers to an
225 entry in the journal. Returns just this entry.</para>
230 <term><option>boot</option></term>
232 <listitem><para>Limit events to the current boot of the system
233 (like <command>journalctl --this--boot</command>).</para></listitem>
237 <term><option><KEY>=<match></option></term>
239 <listitem><para>Match journal fields. See
240 <citerefentry><refentrytitle>systemd.journal-fields</refentrytitle><manvolnum>7</manvolnum></citerefentry>.</para>
247 <title>Examples</title>
248 <para>Retrieve events from this boot from local journal
250 url="http://www.freedesktop.org/wiki/Software/systemd/export">Journal
251 Export Format</ulink>:
253 curl --silent -H'Accept: application/vnd.fdo.journal' \
254 'http://localhost:19531/entries?boot'
258 <para>Listen for core dumps:
260 curl 'http://localhost:19531/entries?follow&MESSAGE_ID=fc2e22bc6ee647b6b90729ab34a250b1'
261 </programlisting></para>
265 <title>See Also</title>
267 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
268 <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
269 <citerefentry><refentrytitle>systemd-journald.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
270 <citerefentry><refentrytitle>systemd.journal-fields</refentrytitle><manvolnum>7</manvolnum></citerefentry>,