]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/systemd-journal-gatewayd.service.xml
journal-gatewayd: add since/until parameters for /entries
[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">
db9ecf05 4<!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
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
ec07c3c8
AK
64 <option>--key=</option>.</para>
65
66 <xi:include href="version-info.xml" xpointer="v198"/></listitem>
c3a7cfb7
ZJS
67 </varlistentry>
68
69 <varlistentry>
70 <term><option>--key=</option></term>
71
49f16281 72 <listitem><para>Specify the path to a file or <constant>AF_UNIX</constant> stream socket to read the
ce82de67 73 secret server key corresponding to the certificate specified with <option>--cert=</option> from. The
ec07c3c8
AK
74 key must be in PEM format.</para>
75
76 <xi:include href="version-info.xml" xpointer="v198"/></listitem>
c3a7cfb7
ZJS
77 </varlistentry>
78
3db93b3f
YW
79 <varlistentry>
80 <term><option>--trust=</option></term>
81
49f16281 82 <listitem><para>Specify the path to a file or <constant>AF_UNIX</constant> stream socket to read a CA
ec07c3c8
AK
83 certificate from. The certificate must be in PEM format.</para>
84
85 <xi:include href="version-info.xml" xpointer="v236"/></listitem>
3db93b3f
YW
86 </varlistentry>
87
c362a432
SB
88 <varlistentry>
89 <term><option>--system</option></term>
90 <term><option>--user</option></term>
91
92 <listitem><para>Limit served entries to entries from system
93 services and the kernel, or to entries from services of
94 current user. This has the same meaning as
95 <option>--system</option> and <option>--user</option> options
96 for
97 <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>. If
98 neither is specified, all accessible entries are served.
ec07c3c8
AK
99 </para>
100
101 <xi:include href="version-info.xml" xpointer="v249"/></listitem>
c362a432
SB
102 </varlistentry>
103
104 <varlistentry>
105 <term><option>-m</option></term>
106 <term><option>--merge</option></term>
107
108 <listitem><para>Serve entries interleaved from all available
109 journals, including other machines. This has the same meaning
110 as <option>--merge</option> option for
ec07c3c8
AK
111 <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>.</para>
112
113 <xi:include href="version-info.xml" xpointer="v249"/></listitem>
c362a432
SB
114 </varlistentry>
115
1aa1e59c
YE
116 <varlistentry>
117 <term><option>-D <replaceable>DIR</replaceable></option></term>
118 <term><option>--directory=<replaceable>DIR</replaceable></option></term>
119
120 <listitem><para>Takes a directory path as argument. If
121 specified, <command>systemd-journal-gatewayd</command> will serve the
122 specified journal directory <replaceable>DIR</replaceable> instead of
ec07c3c8
AK
123 the default runtime and system journal paths.</para>
124
125 <xi:include href="version-info.xml" xpointer="v232"/></listitem>
1aa1e59c
YE
126 </varlistentry>
127
c362a432
SB
128 <varlistentry>
129 <term><option>--file=<replaceable>GLOB</replaceable></option></term>
130
131 <listitem><para>Takes a file glob as an argument. Serve
132 entries from the specified journal files matching
133 <replaceable>GLOB</replaceable> instead of the default runtime
134 and system journal paths. May be specified multiple times, in
135 which case files will be suitably interleaved. This has the same meaning as
136 <option>--file=</option> option for
137 <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
ec07c3c8
AK
138 </para>
139
140 <xi:include href="version-info.xml" xpointer="v249"/></listitem>
c362a432
SB
141 </varlistentry>
142
dfdebb1b
ZJS
143 <xi:include href="standard-options.xml" xpointer="help" />
144 <xi:include href="standard-options.xml" xpointer="version" />
c3a7cfb7
ZJS
145 </variablelist>
146 </refsect1>
147
ee7c77db
ZJS
148 <refsect1>
149 <title>Supported URLs</title>
150
151 <para>The following URLs are recognized:</para>
152
153 <variablelist>
154 <varlistentry>
6b76fa66 155 <term><uri>/browse</uri></term>
ee7c77db 156
ec07c3c8
AK
157 <listitem><para>Interactive browsing.</para>
158
159 <xi:include href="version-info.xml" xpointer="v197"/></listitem>
ee7c77db
ZJS
160 </varlistentry>
161
162 <varlistentry>
1eecafb8 163 <term><uri>/entries[?option1&amp;option2=value…]</uri></term>
ee7c77db
ZJS
164
165 <listitem><para>Retrieval of events in various formats.</para>
166
167 <para>The <option>Accept:</option> part of the HTTP header
168 determines the format. Supported values are described below.
169 </para>
170
171 <para>The <option>Range:</option> part of the HTTP header
172 determines the range of events returned. Supported values are
173 described below.
174 </para>
175
176 <para>GET parameters can be used to modify what events are
177 returned. Supported parameters are described below.</para>
ec07c3c8 178
aefdc112 179 <xi:include href="version-info.xml" xpointer="v197"/>
ee7c77db
ZJS
180 </listitem>
181 </varlistentry>
4203aa37
ZJS
182
183 <varlistentry>
6b76fa66 184 <term><uri>/machine</uri></term>
4203aa37 185
065144aa 186 <listitem><para>Return a JSON structure describing the machine.</para>
4203aa37
ZJS
187
188 <para>Example:
9fccdb0f 189 <programlisting>{ "machine_id" : "8cf7ed9d451ea194b77a9f118f3dc446",
4203aa37
ZJS
190 "boot_id" : "3d3c9efaf556496a9b04259ee35df7f7",
191 "hostname" : "fedora",
192 "os_pretty_name" : "Fedora 19 (Rawhide)",
193 "virtualization" : "kvm",
1eecafb8 194 …}</programlisting>
4203aa37 195 </para>
ec07c3c8
AK
196
197 <xi:include href="version-info.xml" xpointer="v197"/>
4203aa37
ZJS
198 </listitem>
199 </varlistentry>
200
201 <varlistentry>
6b76fa66 202 <term><uri>/fields/<replaceable>FIELD_NAME</replaceable></uri></term>
4203aa37
ZJS
203
204 <listitem><para>Return a list of values of this field present in the logs.</para>
ec07c3c8
AK
205
206 <xi:include href="version-info.xml" xpointer="v197"/>
4203aa37
ZJS
207 </listitem>
208 </varlistentry>
ee7c77db
ZJS
209 </variablelist>
210 </refsect1>
211
212 <refsect1>
213 <title>Accept header</title>
214
215 <para>
6b76fa66 216 <option>Accept: <replaceable>format</replaceable></option>
ee7c77db
ZJS
217 </para>
218
219 <para>Recognized formats:</para>
220
221 <variablelist>
222 <varlistentry>
6b76fa66 223 <term><constant>text/plain</constant></term>
ee7c77db
ZJS
224
225 <listitem><para>The default. Plaintext syslog-like output,
226 one line per journal entry
227 (like <command>journalctl --output short</command>).</para>
ec07c3c8
AK
228
229 <xi:include href="version-info.xml" xpointer="v197"/>
ee7c77db
ZJS
230 </listitem>
231 </varlistentry>
232
233 <varlistentry>
6b76fa66 234 <term><constant>application/json</constant></term>
ee7c77db
ZJS
235
236 <listitem><para>Entries are formatted as JSON data structures,
237 one per line
238 (like <command>journalctl --output json</command>).
717e92ce
ZJS
239 See <ulink url="https://systemd.io/JOURNAL_EXPORT_FORMATS#journal-json-format">Journal JSON Format</ulink>
240 for more information.</para>
ec07c3c8
AK
241
242 <xi:include href="version-info.xml" xpointer="v197"/>
ee7c77db
ZJS
243 </listitem>
244 </varlistentry>
245
246 <varlistentry>
f81bae75 247 <term><constant>text/event-stream</constant></term>
ee7c77db
ZJS
248
249 <listitem><para>Entries are formatted as JSON data structures,
250 wrapped in a format suitable for <ulink
251 url="https://developer.mozilla.org/en-US/docs/Server-sent_events/Using_server-sent_events">
252 Server-Sent Events</ulink>
253 (like <command>journalctl --output json-sse</command>).
254 </para>
ec07c3c8
AK
255
256 <xi:include href="version-info.xml" xpointer="v229"/>
ee7c77db
ZJS
257 </listitem>
258 </varlistentry>
259
260 <varlistentry>
6b76fa66 261 <term><constant>application/vnd.fdo.journal</constant></term>
ee7c77db 262
717e92ce
ZJS
263 <listitem><para>Entries are serialized into a binary (but mostly text-based) stream suitable for
264 backups and network transfer (like <command>journalctl --output export</command>). See <ulink
265 url="https://systemd.io/JOURNAL_EXPORT_FORMATS#journal-export-format">Journal Export Format</ulink>
266 for more information.</para>
ec07c3c8
AK
267
268 <xi:include href="version-info.xml" xpointer="v197"/>
ee7c77db
ZJS
269 </listitem>
270 </varlistentry>
271 </variablelist>
272 </refsect1>
273
274 <refsect1>
275 <title>Range header</title>
276
277 <para>
6b76fa66 278 <option>Range: entries=<replaceable>cursor</replaceable>[[:<replaceable>num_skip</replaceable>]:<replaceable>num_entries</replaceable>]</option>
ee7c77db 279 </para>
435c372c
SB
280 <para>
281 <option>Range: realtime=[<replaceable>since</replaceable>]:[<replaceable>until</replaceable>][[:<replaceable>num_skip</replaceable>]:<replaceable>num_entries</replaceable>]</option>
282 </para>
ee7c77db
ZJS
283
284 <para>where
e9dd6984 285 <replaceable>cursor</replaceable> is a cursor string,
435c372c 286 <replaceable>since</replaceable> and <replaceable>until</replaceable> are timestamps (seconds since 1970-01-01 00:00:00 UTC),
e9dd6984
ZJS
287 <replaceable>num_skip</replaceable> is an integer,
288 <replaceable>num_entries</replaceable> is an unsigned integer.
ee7c77db
ZJS
289 </para>
290
291 <para>Range defaults to all available events.</para>
292 </refsect1>
293
294 <refsect1>
295 <title>URL GET parameters</title>
296
297 <para>Following parameters can be used as part of the URL:</para>
298
299 <variablelist>
300 <varlistentry>
6b76fa66 301 <term><uri>follow</uri></term>
ee7c77db
ZJS
302
303 <listitem><para>wait for new events
304 (like <command>journalctl --follow</command>, except that
305 the number of events returned is not limited).</para>
ec07c3c8
AK
306
307 <xi:include href="version-info.xml" xpointer="v197"/>
ee7c77db
ZJS
308 </listitem>
309 </varlistentry>
310
311 <varlistentry>
6b76fa66 312 <term><uri>discrete</uri></term>
ee7c77db
ZJS
313
314 <listitem><para>Test that the specified cursor refers to an
315 entry in the journal. Returns just this entry.</para>
ec07c3c8
AK
316
317 <xi:include href="version-info.xml" xpointer="v197"/>
ee7c77db
ZJS
318 </listitem>
319 </varlistentry>
320
321 <varlistentry>
6b76fa66 322 <term><uri>boot</uri></term>
ee7c77db
ZJS
323
324 <listitem><para>Limit events to the current boot of the system
ec07c3c8
AK
325 (like <command>journalctl -b</command>).</para>
326
327 <xi:include href="version-info.xml" xpointer="v197"/></listitem>
ee7c77db
ZJS
328 </varlistentry>
329
330 <varlistentry>
6b76fa66 331 <term><uri><replaceable>KEY</replaceable>=<replaceable>match</replaceable></uri></term>
ee7c77db
ZJS
332
333 <listitem><para>Match journal fields. See
334 <citerefentry><refentrytitle>systemd.journal-fields</refentrytitle><manvolnum>7</manvolnum></citerefentry>.</para>
ec07c3c8 335
aefdc112 336 <xi:include href="version-info.xml" xpointer="v197"/>
ee7c77db
ZJS
337 </listitem>
338 </varlistentry>
339 </variablelist>
340 </refsect1>
341
342 <refsect1>
343 <title>Examples</title>
717e92ce
ZJS
344 <para>Retrieve events from this boot from local journal in
345 <ulink url="https://systemd.io/JOURNAL_EXPORT_FORMATS#journal-export-format">Journal Export Format</ulink>:
9fccdb0f
LP
346 <programlisting>curl --silent -H'Accept: application/vnd.fdo.journal' \
347 'http://localhost:19531/entries?boot'</programlisting>
ee7c77db
ZJS
348 </para>
349
350 <para>Listen for core dumps:
9fccdb0f 351 <programlisting>curl 'http://localhost:19531/entries?follow&amp;MESSAGE_ID=fc2e22bc6ee647b6b90729ab34a250b1'</programlisting></para>
ee7c77db
ZJS
352 </refsect1>
353
354 <refsect1>
355 <title>See Also</title>
356 <para>
357 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
358 <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
ee7c77db 359 <citerefentry><refentrytitle>systemd.journal-fields</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
68f21002
MK
360 <citerefentry><refentrytitle>systemd-journald.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
361 <citerefentry><refentrytitle>systemd-journal-remote.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
362 <citerefentry><refentrytitle>systemd-journal-upload.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
ee7c77db
ZJS
363 </para>
364 </refsect1>
365
366</refentry>