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