1 <?xml version='
1.0'
?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*-->
2 <!DOCTYPE refentry PUBLIC
"-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
4 <!ENTITY % entities SYSTEM
"custom-entities.ent" >
9 SPDX-License-Identifier: LGPL-2.1+
11 This file is part of systemd.
13 Copyright 2012 Zbigniew Jędrzejewski-Szmek
16 <refentry id=
"systemd-journal-remote" conditional='HAVE_MICROHTTPD'
17 xmlns:
xi=
"http://www.w3.org/2001/XInclude">
20 <title>systemd-journal-remote
</title>
21 <productname>systemd
</productname>
25 <contrib>Developer
</contrib>
26 <firstname>Zbigniew
</firstname>
27 <surname>Jędrzejewski-Szmek
</surname>
28 <email>zbyszek@in.waw.pl
</email>
34 <refentrytitle>systemd-journal-remote
</refentrytitle>
35 <manvolnum>8</manvolnum>
39 <refname>systemd-journal-remote
</refname>
40 <refpurpose>Receive journal messages over the network
</refpurpose>
45 <command>systemd-journal-remote
</command>
46 <arg choice=
"opt" rep=
"repeat">OPTIONS
</arg>
47 <arg choice=
"opt" rep=
"norepeat">-o/--output=
<replaceable>DIR
</replaceable>|
<replaceable>FILE
</replaceable></arg>
48 <arg choice=
"opt" rep=
"repeat">SOURCES
</arg>
53 <title>Description
</title>
56 <filename>systemd-journal-remote
</filename> is a command to
57 receive serialized journal events and store them to the journal.
58 Input streams are in the
59 <ulink url=
"https://www.freedesktop.org/wiki/Software/systemd/export">
62 i.e. like the output from
63 <command>journalctl --output=export
</command>. For transport over
64 the network, this serialized stream is usually carried over an
70 <title>Sources
</title>
73 Sources can be either
"active"
74 (
<command>systemd-journal-remote
</command> requests and pulls
75 the data), or
"passive"
76 (
<command>systemd-journal-remote
</command> waits for a
77 connection and then receives events pushed by the other side).
81 <command>systemd-journal-remote
</command> can read more than one
82 event stream at a time. They will be interleaved in the output
83 file. In case of
"active" connections, each
"source" is one
84 stream, and in case of
"passive" connections, each connection can
85 result in a separate stream. Sockets can be configured in
86 "accept" mode (i.e. only one connection), or
"listen" mode (i.e.
87 multiple connections, each resulting in a stream).
91 When there are no more connections, and no more can be created
92 (there are no listening sockets), then
93 <command>systemd-journal-remote
</command> will exit.
96 <para>Active sources can be specified in the following
101 <term><arg choice=
"opt" rep=
"repeat">SOURCES
</arg></term>
103 <listitem><para>When
<option>-
</option> is given as a
104 positional argument, events will be read from standard input.
105 Other positional arguments will be treated as filenames
106 to open and read from.
</para></listitem>
110 <term><option>--url=
<replaceable>ADDRESS
</replaceable></option></term>
112 <listitem><para>With the
113 <option>--url=
<replaceable>ADDRESS
</replaceable></option> option,
114 events will be retrieved using HTTP from
115 <replaceable>ADDRESS
</replaceable>. This URL should refer to the
117 <citerefentry><refentrytitle>systemd-journal-gatewayd
</refentrytitle><manvolnum>8</manvolnum></citerefentry>
118 instance, e.g. http://some.host:
19531/ or
119 https://some.host:
19531/.
</para></listitem>
123 <term><option>--getter='
<replaceable>PROG
</replaceable> <arg choice=
"opt" rep=
"repeat">OPTIONS
</arg>'
</option></term>
125 <listitem><para>Program to invoke to retrieve data. The journal
126 event stream must be generated on standard output.
</para>
128 <para>Examples:
</para>
130 <programlisting>--getter='curl
"-HAccept: application/vnd.fdo.journal" https://some.host:
19531/'
</programlisting>
132 <programlisting>--getter='wget
--header=
"Accept: application/vnd.fdo.journal" -O- https://some.host:
19531/'
</programlisting>
137 <para>Passive sources can be specified in the following
142 <term><option>--listen-raw=
<replaceable>ADDRESS
</replaceable></option></term>
144 <listitem><para><replaceable>ADDRESS
</replaceable> must be an
145 address suitable for
<option>ListenStream=
</option> (cf.
146 <citerefentry><refentrytitle>systemd.socket
</refentrytitle><manvolnum>5</manvolnum></citerefentry>).
147 <command>systemd-journal-remote
</command> will listen on this
148 socket for connections. Each connection is expected to be a
149 stream of journal events.
</para>
154 <term><option>--listen-http=
<replaceable>ADDRESS
</replaceable></option></term>
155 <term><option>--listen-https=
<replaceable>ADDRESS
</replaceable></option></term>
157 <listitem><para><replaceable>ADDRESS
</replaceable> must be
158 either a negative integer, in which case it will be
159 interpreted as the (negated) file descriptor number, or an
160 address suitable for
<option>ListenStream=
</option> (c.f.
161 <citerefentry><refentrytitle>systemd.socket
</refentrytitle><manvolnum>5</manvolnum></citerefentry>).
162 In the first case, matching file descriptor must be inherited
164 <varname>$LISTEN_FDS
</varname>/
<varname>$LISTEN_PID
</varname>.
165 In the second case, an HTTP or HTTPS server will be spawned on
166 this port, respectively for
<option>--listen-http
</option> and
167 <option>--listen-https
</option>. Currently, only POST requests
168 to
<filename>/upload
</filename> with
<literal>Content-Type:
169 application/vnd.fdo.journal
</literal> are supported.
</para>
174 <term><varname>$LISTEN_FDS
</varname></term>
176 <listitem><para><command>systemd-journal-remote
</command>
178 <varname>$LISTEN_FDS
</varname>/
<varname>$LISTEN_PID
</varname>
179 protocol. Open sockets inherited through socket activation
180 behave like those opened with
<option>--listen-raw=
</option>
181 described above, unless they are specified as an argument in
182 <option>--listen-http=-
<replaceable>n
</replaceable></option>
184 <option>--listen-https=-
<replaceable>n
</replaceable></option>
185 above. In the latter case, an HTTP or HTTPS server will be
186 spawned using this descriptor and connections must be made
187 over the HTTP protocol.
</para>
192 <term><option>--key=
</option></term>
195 Takes a path to a SSL key file in PEM format.
196 Defaults to
<filename>&CERTIFICATE_ROOT;/private/journal-remote.pem
</filename>.
197 This option can be used with
<option>--listen-https=
</option>.
202 <term><option>--cert=
</option></term>
205 Takes a path to a SSL certificate file in PEM format.
206 Defaults to
<filename>&CERTIFICATE_ROOT;/certs/journal-remote.pem
</filename>.
207 This option can be used with
<option>--listen-https=
</option>.
212 <term><option>--trust=
</option></term>
215 Takes a path to a SSL CA certificate file in PEM format,
216 or
<option>all
</option>. If
<option>all
</option> is set,
217 then certificate checking will be disabled.
218 Defaults to
<filename>&CERTIFICATE_ROOT;/ca/trusted.pem
</filename>.
219 This option can be used with
<option>--listen-https=
</option>.
224 <term><option>--gnutls-log=
</option></term>
227 Takes a comma separated list of gnutls logging categories.
228 This option can be used with
<option>--listen-http=
</option> or
229 <option>--listen-https=
</option>.
239 <para>The location of the output journal can be specified
240 with
<option>-o
</option> or
<option>--output=
</option>.
245 <term><option>--output=
<replaceable>FILE
</replaceable></option></term>
247 <listitem><para>Will write to this journal file. The filename
248 must end with
<filename>.journal
</filename>. The file will be
249 created if it does not exist. If necessary (journal file full,
250 or corrupted), the file will be renamed following normal
251 journald rules and a new journal file will be created in its
252 stead.
</para></listitem>
256 <term><option>--output=
<replaceable>DIR
</replaceable></option></term>
258 <listitem><para>Will create journal files underneath directory
259 <replaceable>DIR
</replaceable>. The directory must exist. If
260 necessary (journal files over size, or corrupted), journal
261 files will be rotated following normal journald rules. Names
262 of files underneath
<replaceable>DIR
</replaceable> will be
263 generated using the rules described below.
</para></listitem>
267 <para>If
<option>--output=
</option> is not used, the output
268 directory
<filename>/var/log/journal/remote/
</filename> will be
269 used. In case the output file is not specified, journal files
270 will be created underneath the selected directory. Files will be
272 <filename>remote-
<replaceable>hostname
</replaceable>.journal
</filename>,
273 where the
<replaceable>hostname
</replaceable> part is the
274 escaped hostname of the source endpoint of the connection, or the
275 numerical address if the hostname cannot be determined.
</para>
277 <para>In the case that
"active" sources are given by the positional
278 arguments or
<option>--getter=
</option> option, the output file name
279 must always be given explicitly.
</para>
283 <title>Options
</title>
285 <para>The following options are understood:
</para>
289 <term><option>--split-mode
</option></term>
291 <listitem><para>One of
<constant>none
</constant> or
292 <constant>host
</constant>. For the first, only one output
293 journal file is used. For the latter, a separate output file
294 is used, based on the hostname of the other endpoint of a
297 <para>In the case that
"active" sources are given by the positional
298 arguments or
<option>--getter=
</option> option, the output file name must
299 always be given explicitly and only
<constant>none
</constant>
300 is allowed.
</para></listitem>
304 <term><option>--compress
</option> [
<replaceable>BOOL
</replaceable>]
</term>
306 <listitem><para>If this is set to
<literal>yes
</literal> then compress
307 the data in the journal using XZ. The default is
<literal>yes
</literal>.
312 <term><option>--seal
</option> [
<replaceable>BOOL
</replaceable>]
</term>
314 <listitem><para>If this is set to
<literal>yes
</literal> then
315 periodically sign the data in the journal using Forward Secure Sealing.
316 The default is
<literal>no
</literal>.
</para></listitem>
319 <xi:include href=
"standard-options.xml" xpointer=
"help" />
320 <xi:include href=
"standard-options.xml" xpointer=
"version" />
325 <title>Examples
</title>
326 <para>Copy local journal events to a different journal directory:
328 journalctl -o export | systemd-journal-remote -o /tmp/dir/foo.journal -
332 <para>Retrieve all available events from a remote
333 <citerefentry><refentrytitle>systemd-journal-gatewayd
</refentrytitle><manvolnum>8</manvolnum></citerefentry>
334 instance and store them in
335 <filename>/var/log/journal/remote/remote-some.host.journal
</filename>:
337 systemd-journal-remote --url http://some.host:
19531/
341 <para>Retrieve current boot events and wait for new events from a remote
342 <citerefentry><refentrytitle>systemd-journal-gatewayd
</refentrytitle><manvolnum>8</manvolnum></citerefentry>
343 instance, and store them in
344 <filename>/var/log/journal/remote/remote-some.host.journal
</filename>:
346 systemd-journal-remote --url http://some.host:
19531/entries?boot
&follow
352 <title>See Also
</title>
354 <citerefentry><refentrytitle>systemd-journal-upload
</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
355 <citerefentry><refentrytitle>journalctl
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
356 <citerefentry><refentrytitle>systemd-journald.service
</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
357 <citerefentry><refentrytitle>systemd-journal-gatewayd.service
</refentrytitle><manvolnum>8</manvolnum></citerefentry>
358 <citerefentry><refentrytitle>journal-remote.conf
</refentrytitle><manvolnum>5</manvolnum></citerefentry>