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