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