]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/systemd-journal-gatewayd.service.xml
travis: use UBSan checks from OSS-Fuzz
[thirdparty/systemd.git] / man / systemd-journal-gatewayd.service.xml
CommitLineData
514094f9 1<?xml version='1.0'?>
3a54a157
ZJS
2<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
0307f791 4<!-- SPDX-License-Identifier: LGPL-2.1+ -->
ee7c77db 5
dfdebb1b
ZJS
6<refentry id="systemd-journal-gatewayd.service" conditional='HAVE_MICROHTTPD'
7 xmlns:xi="http://www.w3.org/2001/XInclude">
ee7c77db
ZJS
8
9 <refentryinfo>
10 <title>systemd-journal-gatewayd.service</title>
11 <productname>systemd</productname>
ee7c77db
ZJS
12 </refentryinfo>
13
14 <refmeta>
15 <refentrytitle>systemd-journal-gatewayd.service</refentrytitle>
16 <manvolnum>8</manvolnum>
17 </refmeta>
18
19 <refnamediv>
20 <refname>systemd-journal-gatewayd.service</refname>
21 <refname>systemd-journal-gatewayd.socket</refname>
22 <refname>systemd-journal-gatewayd</refname>
23 <refpurpose>HTTP server for journal events</refpurpose>
24 </refnamediv>
25
26 <refsynopsisdiv>
27 <para><filename>systemd-journal-gatewayd.service</filename></para>
28 <para><filename>systemd-journal-gatewayd.socket</filename></para>
c3a7cfb7 29 <cmdsynopsis>
12b42c76 30 <command>/usr/lib/systemd/systemd-journal-gatewayd</command>
c3a7cfb7 31 <arg choice="opt" rep="repeat">OPTIONS</arg>
ee7c77db
ZJS
32 </cmdsynopsis>
33 </refsynopsisdiv>
34
35 <refsect1>
36 <title>Description</title>
37
38 <para><command>systemd-journal-gatewayd</command> serves journal
39 events over the network. Clients must connect using
c3a7cfb7
ZJS
40 HTTP. The server listens on port 19531 by default.
41 If <option>--cert=</option> is specified, the server expects
42 HTTPS connections.</para>
ee7c77db
ZJS
43
44 <para>The program is started by
45 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>
46 and expects to receive a single socket. Use
47 <command>systemctl start systemd-journal-gatewayd.socket</command> to start
48 the service, and <command>systemctl enable systemd-journal-gatewayd.socket</command>
49 to have it started on boot.</para>
50 </refsect1>
51
c3a7cfb7
ZJS
52 <refsect1>
53 <title>Options</title>
54
55 <para>The following options are understood:</para>
56
57 <variablelist>
c3a7cfb7
ZJS
58 <varlistentry>
59 <term><option>--cert=</option></term>
60
61 <listitem><para>Specify the path to a file containing a server
62 certificate in PEM format. This option switches
63 <command>systemd-journal-gatewayd</command> into HTTPS mode
64 and must be used together with
65 <option>--key=</option>.</para></listitem>
66 </varlistentry>
67
68 <varlistentry>
69 <term><option>--key=</option></term>
70
71 <listitem><para>Specify the path to a file containing a server
72 key in PEM format corresponding to the certificate specified
73 with <option>--cert=</option>.</para></listitem>
74 </varlistentry>
75
3db93b3f
YW
76 <varlistentry>
77 <term><option>--trust=</option></term>
78
79 <listitem><para>Specify the path to a file containing a
80 CA certificate in PEM format.</para></listitem>
81 </varlistentry>
82
1aa1e59c
YE
83 <varlistentry>
84 <term><option>-D <replaceable>DIR</replaceable></option></term>
85 <term><option>--directory=<replaceable>DIR</replaceable></option></term>
86
87 <listitem><para>Takes a directory path as argument. If
88 specified, <command>systemd-journal-gatewayd</command> will serve the
89 specified journal directory <replaceable>DIR</replaceable> instead of
90 the default runtime and system journal paths.</para></listitem>
91 </varlistentry>
92
dfdebb1b
ZJS
93 <xi:include href="standard-options.xml" xpointer="help" />
94 <xi:include href="standard-options.xml" xpointer="version" />
c3a7cfb7
ZJS
95 </variablelist>
96 </refsect1>
97
ee7c77db
ZJS
98 <refsect1>
99 <title>Supported URLs</title>
100
101 <para>The following URLs are recognized:</para>
102
103 <variablelist>
104 <varlistentry>
6b76fa66 105 <term><uri>/browse</uri></term>
ee7c77db
ZJS
106
107 <listitem><para>Interactive browsing.</para></listitem>
108 </varlistentry>
109
110 <varlistentry>
1eecafb8 111 <term><uri>/entries[?option1&amp;option2=value…]</uri></term>
ee7c77db
ZJS
112
113 <listitem><para>Retrieval of events in various formats.</para>
114
115 <para>The <option>Accept:</option> part of the HTTP header
116 determines the format. Supported values are described below.
117 </para>
118
119 <para>The <option>Range:</option> part of the HTTP header
120 determines the range of events returned. Supported values are
121 described below.
122 </para>
123
124 <para>GET parameters can be used to modify what events are
125 returned. Supported parameters are described below.</para>
126 </listitem>
127 </varlistentry>
4203aa37
ZJS
128
129 <varlistentry>
6b76fa66 130 <term><uri>/machine</uri></term>
4203aa37 131
065144aa 132 <listitem><para>Return a JSON structure describing the machine.</para>
4203aa37
ZJS
133
134 <para>Example:
9fccdb0f 135 <programlisting>{ "machine_id" : "8cf7ed9d451ea194b77a9f118f3dc446",
4203aa37
ZJS
136 "boot_id" : "3d3c9efaf556496a9b04259ee35df7f7",
137 "hostname" : "fedora",
138 "os_pretty_name" : "Fedora 19 (Rawhide)",
139 "virtualization" : "kvm",
1eecafb8 140 …}</programlisting>
4203aa37
ZJS
141 </para>
142 </listitem>
143 </varlistentry>
144
145 <varlistentry>
6b76fa66 146 <term><uri>/fields/<replaceable>FIELD_NAME</replaceable></uri></term>
4203aa37
ZJS
147
148 <listitem><para>Return a list of values of this field present in the logs.</para>
149 </listitem>
150 </varlistentry>
ee7c77db
ZJS
151 </variablelist>
152 </refsect1>
153
154 <refsect1>
155 <title>Accept header</title>
156
157 <para>
6b76fa66 158 <option>Accept: <replaceable>format</replaceable></option>
ee7c77db
ZJS
159 </para>
160
161 <para>Recognized formats:</para>
162
163 <variablelist>
164 <varlistentry>
6b76fa66 165 <term><constant>text/plain</constant></term>
ee7c77db
ZJS
166
167 <listitem><para>The default. Plaintext syslog-like output,
168 one line per journal entry
169 (like <command>journalctl --output short</command>).</para>
170 </listitem>
171 </varlistentry>
172
173 <varlistentry>
6b76fa66 174 <term><constant>application/json</constant></term>
ee7c77db
ZJS
175
176 <listitem><para>Entries are formatted as JSON data structures,
177 one per line
178 (like <command>journalctl --output json</command>).
179 See <ulink
28a0ad81 180 url="https://www.freedesktop.org/wiki/Software/systemd/json">Journal
ee7c77db
ZJS
181 JSON Format</ulink> for more information.</para>
182 </listitem>
183 </varlistentry>
184
185 <varlistentry>
f81bae75 186 <term><constant>text/event-stream</constant></term>
ee7c77db
ZJS
187
188 <listitem><para>Entries are formatted as JSON data structures,
189 wrapped in a format suitable for <ulink
190 url="https://developer.mozilla.org/en-US/docs/Server-sent_events/Using_server-sent_events">
191 Server-Sent Events</ulink>
192 (like <command>journalctl --output json-sse</command>).
193 </para>
194 </listitem>
195 </varlistentry>
196
197 <varlistentry>
6b76fa66 198 <term><constant>application/vnd.fdo.journal</constant></term>
ee7c77db
ZJS
199
200 <listitem><para>Entries are serialized into a binary (but
201 mostly text-based) stream suitable for backups and network
202 transfer
203 (like <command>journalctl --output export</command>).
204 See <ulink
28a0ad81 205 url="https://www.freedesktop.org/wiki/Software/systemd/export">Journal
ee7c77db
ZJS
206 Export Format</ulink> for more information.</para>
207 </listitem>
208 </varlistentry>
209 </variablelist>
210 </refsect1>
211
212 <refsect1>
213 <title>Range header</title>
214
215 <para>
6b76fa66 216 <option>Range: entries=<replaceable>cursor</replaceable>[[:<replaceable>num_skip</replaceable>]:<replaceable>num_entries</replaceable>]</option>
ee7c77db
ZJS
217 </para>
218
219 <para>where
220 <option>cursor</option> is a cursor string,
221 <option>num_skip</option> is an integer,
222 <option>num_entries</option> is an unsigned integer.
223 </para>
224
225 <para>Range defaults to all available events.</para>
226 </refsect1>
227
228 <refsect1>
229 <title>URL GET parameters</title>
230
231 <para>Following parameters can be used as part of the URL:</para>
232
233 <variablelist>
234 <varlistentry>
6b76fa66 235 <term><uri>follow</uri></term>
ee7c77db
ZJS
236
237 <listitem><para>wait for new events
238 (like <command>journalctl --follow</command>, except that
239 the number of events returned is not limited).</para>
240 </listitem>
241 </varlistentry>
242
243 <varlistentry>
6b76fa66 244 <term><uri>discrete</uri></term>
ee7c77db
ZJS
245
246 <listitem><para>Test that the specified cursor refers to an
247 entry in the journal. Returns just this entry.</para>
248 </listitem>
249 </varlistentry>
250
251 <varlistentry>
6b76fa66 252 <term><uri>boot</uri></term>
ee7c77db
ZJS
253
254 <listitem><para>Limit events to the current boot of the system
f94abc66 255 (like <command>journalctl -b</command>).</para></listitem>
ee7c77db
ZJS
256 </varlistentry>
257
258 <varlistentry>
6b76fa66 259 <term><uri><replaceable>KEY</replaceable>=<replaceable>match</replaceable></uri></term>
ee7c77db
ZJS
260
261 <listitem><para>Match journal fields. See
262 <citerefentry><refentrytitle>systemd.journal-fields</refentrytitle><manvolnum>7</manvolnum></citerefentry>.</para>
263 </listitem>
264 </varlistentry>
265 </variablelist>
266 </refsect1>
267
268 <refsect1>
269 <title>Examples</title>
270 <para>Retrieve events from this boot from local journal
271 in <ulink
28a0ad81 272 url="https://www.freedesktop.org/wiki/Software/systemd/export">Journal
ee7c77db 273 Export Format</ulink>:
9fccdb0f
LP
274 <programlisting>curl --silent -H'Accept: application/vnd.fdo.journal' \
275 'http://localhost:19531/entries?boot'</programlisting>
ee7c77db
ZJS
276 </para>
277
278 <para>Listen for core dumps:
9fccdb0f 279 <programlisting>curl 'http://localhost:19531/entries?follow&amp;MESSAGE_ID=fc2e22bc6ee647b6b90729ab34a250b1'</programlisting></para>
ee7c77db
ZJS
280 </refsect1>
281
282 <refsect1>
283 <title>See Also</title>
284 <para>
285 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
286 <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
ee7c77db 287 <citerefentry><refentrytitle>systemd.journal-fields</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
68f21002
MK
288 <citerefentry><refentrytitle>systemd-journald.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
289 <citerefentry><refentrytitle>systemd-journal-remote.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
290 <citerefentry><refentrytitle>systemd-journal-upload.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
ee7c77db
ZJS
291 </para>
292 </refsect1>
293
294</refentry>