]>
Commit | Line | Data |
---|---|---|
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 | ||
49f16281 LP |
61 | <listitem><para>Specify the path to a file or <constant>AF_UNIX</constant> stream socket to read the |
62 | server certificate from. The certificate must be in PEM format. This option switches | |
63 | <command>systemd-journal-gatewayd</command> into HTTPS mode and must be used together with | |
c3a7cfb7 ZJS |
64 | <option>--key=</option>.</para></listitem> |
65 | </varlistentry> | |
66 | ||
67 | <varlistentry> | |
68 | <term><option>--key=</option></term> | |
69 | ||
49f16281 LP |
70 | <listitem><para>Specify the path to a file or <constant>AF_UNIX</constant> stream socket to read the |
71 | server key corresponding to the certificate specified with <option>--cert=</option> from. The key | |
72 | must be in PEM format.</para></listitem> | |
c3a7cfb7 ZJS |
73 | </varlistentry> |
74 | ||
3db93b3f YW |
75 | <varlistentry> |
76 | <term><option>--trust=</option></term> | |
77 | ||
49f16281 LP |
78 | <listitem><para>Specify the path to a file or <constant>AF_UNIX</constant> stream socket to read a CA |
79 | certificate from. The certificate must be in PEM format.</para></listitem> | |
3db93b3f YW |
80 | </varlistentry> |
81 | ||
1aa1e59c YE |
82 | <varlistentry> |
83 | <term><option>-D <replaceable>DIR</replaceable></option></term> | |
84 | <term><option>--directory=<replaceable>DIR</replaceable></option></term> | |
85 | ||
86 | <listitem><para>Takes a directory path as argument. If | |
87 | specified, <command>systemd-journal-gatewayd</command> will serve the | |
88 | specified journal directory <replaceable>DIR</replaceable> instead of | |
89 | the default runtime and system journal paths.</para></listitem> | |
90 | </varlistentry> | |
91 | ||
dfdebb1b ZJS |
92 | <xi:include href="standard-options.xml" xpointer="help" /> |
93 | <xi:include href="standard-options.xml" xpointer="version" /> | |
c3a7cfb7 ZJS |
94 | </variablelist> |
95 | </refsect1> | |
96 | ||
ee7c77db ZJS |
97 | <refsect1> |
98 | <title>Supported URLs</title> | |
99 | ||
100 | <para>The following URLs are recognized:</para> | |
101 | ||
102 | <variablelist> | |
103 | <varlistentry> | |
6b76fa66 | 104 | <term><uri>/browse</uri></term> |
ee7c77db ZJS |
105 | |
106 | <listitem><para>Interactive browsing.</para></listitem> | |
107 | </varlistentry> | |
108 | ||
109 | <varlistentry> | |
1eecafb8 | 110 | <term><uri>/entries[?option1&option2=value…]</uri></term> |
ee7c77db ZJS |
111 | |
112 | <listitem><para>Retrieval of events in various formats.</para> | |
113 | ||
114 | <para>The <option>Accept:</option> part of the HTTP header | |
115 | determines the format. Supported values are described below. | |
116 | </para> | |
117 | ||
118 | <para>The <option>Range:</option> part of the HTTP header | |
119 | determines the range of events returned. Supported values are | |
120 | described below. | |
121 | </para> | |
122 | ||
123 | <para>GET parameters can be used to modify what events are | |
124 | returned. Supported parameters are described below.</para> | |
125 | </listitem> | |
126 | </varlistentry> | |
4203aa37 ZJS |
127 | |
128 | <varlistentry> | |
6b76fa66 | 129 | <term><uri>/machine</uri></term> |
4203aa37 | 130 | |
065144aa | 131 | <listitem><para>Return a JSON structure describing the machine.</para> |
4203aa37 ZJS |
132 | |
133 | <para>Example: | |
9fccdb0f | 134 | <programlisting>{ "machine_id" : "8cf7ed9d451ea194b77a9f118f3dc446", |
4203aa37 ZJS |
135 | "boot_id" : "3d3c9efaf556496a9b04259ee35df7f7", |
136 | "hostname" : "fedora", | |
137 | "os_pretty_name" : "Fedora 19 (Rawhide)", | |
138 | "virtualization" : "kvm", | |
1eecafb8 | 139 | …}</programlisting> |
4203aa37 ZJS |
140 | </para> |
141 | </listitem> | |
142 | </varlistentry> | |
143 | ||
144 | <varlistentry> | |
6b76fa66 | 145 | <term><uri>/fields/<replaceable>FIELD_NAME</replaceable></uri></term> |
4203aa37 ZJS |
146 | |
147 | <listitem><para>Return a list of values of this field present in the logs.</para> | |
148 | </listitem> | |
149 | </varlistentry> | |
ee7c77db ZJS |
150 | </variablelist> |
151 | </refsect1> | |
152 | ||
153 | <refsect1> | |
154 | <title>Accept header</title> | |
155 | ||
156 | <para> | |
6b76fa66 | 157 | <option>Accept: <replaceable>format</replaceable></option> |
ee7c77db ZJS |
158 | </para> |
159 | ||
160 | <para>Recognized formats:</para> | |
161 | ||
162 | <variablelist> | |
163 | <varlistentry> | |
6b76fa66 | 164 | <term><constant>text/plain</constant></term> |
ee7c77db ZJS |
165 | |
166 | <listitem><para>The default. Plaintext syslog-like output, | |
167 | one line per journal entry | |
168 | (like <command>journalctl --output short</command>).</para> | |
169 | </listitem> | |
170 | </varlistentry> | |
171 | ||
172 | <varlistentry> | |
6b76fa66 | 173 | <term><constant>application/json</constant></term> |
ee7c77db ZJS |
174 | |
175 | <listitem><para>Entries are formatted as JSON data structures, | |
176 | one per line | |
177 | (like <command>journalctl --output json</command>). | |
178 | See <ulink | |
28a0ad81 | 179 | url="https://www.freedesktop.org/wiki/Software/systemd/json">Journal |
ee7c77db ZJS |
180 | JSON Format</ulink> for more information.</para> |
181 | </listitem> | |
182 | </varlistentry> | |
183 | ||
184 | <varlistentry> | |
f81bae75 | 185 | <term><constant>text/event-stream</constant></term> |
ee7c77db ZJS |
186 | |
187 | <listitem><para>Entries are formatted as JSON data structures, | |
188 | wrapped in a format suitable for <ulink | |
189 | url="https://developer.mozilla.org/en-US/docs/Server-sent_events/Using_server-sent_events"> | |
190 | Server-Sent Events</ulink> | |
191 | (like <command>journalctl --output json-sse</command>). | |
192 | </para> | |
193 | </listitem> | |
194 | </varlistentry> | |
195 | ||
196 | <varlistentry> | |
6b76fa66 | 197 | <term><constant>application/vnd.fdo.journal</constant></term> |
ee7c77db ZJS |
198 | |
199 | <listitem><para>Entries are serialized into a binary (but | |
200 | mostly text-based) stream suitable for backups and network | |
201 | transfer | |
202 | (like <command>journalctl --output export</command>). | |
203 | See <ulink | |
28a0ad81 | 204 | url="https://www.freedesktop.org/wiki/Software/systemd/export">Journal |
ee7c77db ZJS |
205 | Export Format</ulink> for more information.</para> |
206 | </listitem> | |
207 | </varlistentry> | |
208 | </variablelist> | |
209 | </refsect1> | |
210 | ||
211 | <refsect1> | |
212 | <title>Range header</title> | |
213 | ||
214 | <para> | |
6b76fa66 | 215 | <option>Range: entries=<replaceable>cursor</replaceable>[[:<replaceable>num_skip</replaceable>]:<replaceable>num_entries</replaceable>]</option> |
ee7c77db ZJS |
216 | </para> |
217 | ||
218 | <para>where | |
e9dd6984 ZJS |
219 | <replaceable>cursor</replaceable> is a cursor string, |
220 | <replaceable>num_skip</replaceable> is an integer, | |
221 | <replaceable>num_entries</replaceable> is an unsigned integer. | |
ee7c77db ZJS |
222 | </para> |
223 | ||
224 | <para>Range defaults to all available events.</para> | |
225 | </refsect1> | |
226 | ||
227 | <refsect1> | |
228 | <title>URL GET parameters</title> | |
229 | ||
230 | <para>Following parameters can be used as part of the URL:</para> | |
231 | ||
232 | <variablelist> | |
233 | <varlistentry> | |
6b76fa66 | 234 | <term><uri>follow</uri></term> |
ee7c77db ZJS |
235 | |
236 | <listitem><para>wait for new events | |
237 | (like <command>journalctl --follow</command>, except that | |
238 | the number of events returned is not limited).</para> | |
239 | </listitem> | |
240 | </varlistentry> | |
241 | ||
242 | <varlistentry> | |
6b76fa66 | 243 | <term><uri>discrete</uri></term> |
ee7c77db ZJS |
244 | |
245 | <listitem><para>Test that the specified cursor refers to an | |
246 | entry in the journal. Returns just this entry.</para> | |
247 | </listitem> | |
248 | </varlistentry> | |
249 | ||
250 | <varlistentry> | |
6b76fa66 | 251 | <term><uri>boot</uri></term> |
ee7c77db ZJS |
252 | |
253 | <listitem><para>Limit events to the current boot of the system | |
f94abc66 | 254 | (like <command>journalctl -b</command>).</para></listitem> |
ee7c77db ZJS |
255 | </varlistentry> |
256 | ||
257 | <varlistentry> | |
6b76fa66 | 258 | <term><uri><replaceable>KEY</replaceable>=<replaceable>match</replaceable></uri></term> |
ee7c77db ZJS |
259 | |
260 | <listitem><para>Match journal fields. See | |
261 | <citerefentry><refentrytitle>systemd.journal-fields</refentrytitle><manvolnum>7</manvolnum></citerefentry>.</para> | |
262 | </listitem> | |
263 | </varlistentry> | |
264 | </variablelist> | |
265 | </refsect1> | |
266 | ||
267 | <refsect1> | |
268 | <title>Examples</title> | |
269 | <para>Retrieve events from this boot from local journal | |
270 | in <ulink | |
28a0ad81 | 271 | url="https://www.freedesktop.org/wiki/Software/systemd/export">Journal |
ee7c77db | 272 | Export Format</ulink>: |
9fccdb0f LP |
273 | <programlisting>curl --silent -H'Accept: application/vnd.fdo.journal' \ |
274 | 'http://localhost:19531/entries?boot'</programlisting> | |
ee7c77db ZJS |
275 | </para> |
276 | ||
277 | <para>Listen for core dumps: | |
9fccdb0f | 278 | <programlisting>curl 'http://localhost:19531/entries?follow&MESSAGE_ID=fc2e22bc6ee647b6b90729ab34a250b1'</programlisting></para> |
ee7c77db ZJS |
279 | </refsect1> |
280 | ||
281 | <refsect1> | |
282 | <title>See Also</title> | |
283 | <para> | |
284 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
285 | <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
ee7c77db | 286 | <citerefentry><refentrytitle>systemd.journal-fields</refentrytitle><manvolnum>7</manvolnum></citerefentry>, |
68f21002 MK |
287 | <citerefentry><refentrytitle>systemd-journald.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>, |
288 | <citerefentry><refentrytitle>systemd-journal-remote.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>, | |
289 | <citerefentry><refentrytitle>systemd-journal-upload.service</refentrytitle><manvolnum>8</manvolnum></citerefentry> | |
ee7c77db ZJS |
290 | </para> |
291 | </refsect1> | |
292 | ||
293 | </refentry> |