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 This file is part of systemd.
11 Copyright 2012 Zbigniew Jędrzejewski-Szmek
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.
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.
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/>.
27 <refentry id=
"systemd-journal-remote" conditional='HAVE_MICROHTTPD'
28 xmlns:
xi=
"http://www.w3.org/2001/XInclude">
31 <title>systemd-journal-remote
</title>
32 <productname>systemd
</productname>
36 <contrib>Developer
</contrib>
37 <firstname>Zbigniew
</firstname>
38 <surname>Jędrzejewski-Szmek
</surname>
39 <email>zbyszek@in.waw.pl
</email>
45 <refentrytitle>systemd-journal-remote
</refentrytitle>
46 <manvolnum>8</manvolnum>
50 <refname>systemd-journal-remote
</refname>
51 <refpurpose>Receive journal messages over the network
</refpurpose>
56 <command>systemd-journal-remote
</command>
57 <arg choice=
"opt" rep=
"repeat">OPTIONS
</arg>
58 <arg choice=
"opt" rep=
"norepeat">-o/--output=
<replaceable>DIR
</replaceable>|
<replaceable>FILE
</replaceable></arg>
59 <arg choice=
"opt" rep=
"repeat">SOURCES
</arg>
64 <title>Description
</title>
67 <filename>systemd-journal-remote
</filename> is a command to
68 receive serialized journal events and store them to the journal.
69 Input streams are in the
70 <ulink url=
"http://www.freedesktop.org/wiki/Software/systemd/export">
73 i.e. like the output from
74 <command>journalctl --output=export
</command>. For transport over
75 the network, this serialized stream is usually carried over an
81 <title>Sources
</title>
84 Sources can be either
"active"
85 (
<command>systemd-journal-remote
</command> requests and pulls
86 the data), or
"passive"
87 (
<command>systemd-journal-remote
</command> waits for a
88 connection and then receives events pushed by the other side).
92 <command>systemd-journal-remote
</command> can read more than one
93 event stream at a time. They will be interleaved in the output
94 file. In case of
"active" connections, each
"source" is one
95 stream, and in case of
"passive" connections, each connection can
96 result in a separate stream. Sockets can be configured in
97 "accept" mode (i.e. only one connection), or
"listen" mode (i.e.
98 multiple connections, each resulting in a stream).
102 When there are no more connections, and no more can be created
103 (there are no listening sockets), then
104 <command>systemd-journal-remote
</command> will exit.
107 <para>Active sources can be specified in the following
112 <listitem><para>When
<option>-
</option> is given as a
113 positional argument, events will be read from standard input.
114 Other positional arguments will be treated as filenames
115 to open and read from.
</para></listitem>
119 <term><option>--url=
<replaceable>ADDRESS
</replaceable></option></term>
121 <listitem><para>With the
122 <option>--url=
<replaceable>ADDRESS
</replaceable></option> option,
123 events will be retrieved using HTTP from
124 <replaceable>ADDRESS
</replaceable>. This URL should refer to the
126 <citerefentry><refentrytitle>systemd-journal-gatewayd
</refentrytitle><manvolnum>8</manvolnum></citerefentry>
127 instance (e.g.
<ulink>http://some.host:
19531/
</ulink> or
128 <ulink>https://some.host:
19531/
</ulink>).
</para></listitem>
132 <para>Passive sources can be specified in the following
137 <term><option>--listen-raw=
<replaceable>ADDRESS
</replaceable></option></term>
139 <listitem><para><replaceable>ADDRESS
</replaceable> must be an
140 address suitable for
<option>ListenStream=
</option> (cf.
141 <citerefentry><refentrytitle>systemd.socket
</refentrytitle><manvolnum>5</manvolnum></citerefentry>).
142 <command>systemd-journal-remote
</command> will listen on this
143 socket for connections. Each connection is expected to be a
144 stream of journal events.
</para>
149 <term><option>--listen-http=
<replaceable>ADDRESS
</replaceable></option></term>
150 <term><option>--listen-https=
<replaceable>ADDRESS
</replaceable></option></term>
152 <listitem><para><replaceable>ADDRESS
</replaceable> must be
153 either a negative integer, in which case it will be
154 interpreted as the (negated) file descriptor number, or an
155 address suitable for
<option>ListenStream=
</option> (c.f.
156 <citerefentry><refentrytitle>systemd.socket
</refentrytitle><manvolnum>5</manvolnum></citerefentry>).
157 In the first case, matching file descriptor must be inherited
159 <varname>$LISTEN_FDS
</varname>/
<varname>$LISTEN_PID
</varname>.
160 In the second case, an HTTP or HTTPS server will be spawned on
161 this port, respectively for
<option>--listen-http
</option> and
162 <option>--listen-https
</option>. Currently, only POST requests
163 to
<filename>/upload
</filename> with
<literal>Content-Type:
164 application/vnd.fdo.journal
</literal> are supported.
</para>
169 <term><varname>$LISTEN_FDS
</varname></term>
171 <listitem><para><command>systemd-journal-remote
</command>
173 <varname>$LISTEN_FDS
</varname>/
<varname>$LISTEN_PID
</varname>
174 protocol. Open sockets inherited through socket activation
175 behave like those opened with
<option>--listen-raw=
</option>
176 described above, unless they are specified as an argument in
177 <option>--listen-http=-
<replaceable>n
</replaceable></option>
179 <option>--listen-https=-
<replaceable>n
</replaceable></option>
180 above. In the latter case, an HTTP or HTTPS server will be
181 spawned using this descriptor and connections must be made
182 over the HTTP protocol.
</para>
192 <para>The location of the output journal can be specified
193 with
<option>-o
</option> or
<option>--output=
</option>. For
"active"
194 sources, this option is required.
199 <term><option>--output=
<replaceable>FILE
</replaceable></option></term>
201 <listitem><para>Will write to this journal file. The filename
202 must end with
<filename>.journal
</filename>. The file will be
203 created if it does not exist. If necessary (journal file full,
204 or corrupted), the file will be renamed following normal
205 journald rules and a new journal file will be created in its
206 stead.
</para></listitem>
210 <term><option>--output=
<replaceable>DIR
</replaceable></option></term>
212 <listitem><para>Will create journal files underneath directory
213 <replaceable>DIR
</replaceable>. The directory must exist. If
214 necessary (journal files over size, or corrupted), journal
215 files will be rotated following normal journald rules. Names
216 of files underneath
<replaceable>DIR
</replaceable> will be
217 generated using the rules described below.
</para></listitem>
221 <para>If
<option>--output=
</option> is not used, the output
222 directory
<filename>/var/log/journal/remote/
</filename> will be
223 used. In case the output file is not specified, journal files
224 will be created underneath the selected directory. Files will be
226 <filename>remote-
<replaceable>hostname
</replaceable>.journal
</filename>,
227 where the
<replaceable>hostname
</replaceable> part is the
228 escaped hostname of the source endpoint of the connection, or the
229 numerical address if the hostname cannot be determined.
</para>
231 <para>In case of
"active" sources, the output file name must
232 always be given explicitly.
</para>
236 <title>Options
</title>
238 <para>The following options are understood:
</para>
242 <term><option>--split-mode
</option></term>
244 <listitem><para>One of
<constant>none
</constant> or
245 <constant>host
</constant>. For the first, only one output
246 journal file is used. For the latter, a separate output file
247 is used, based on the hostname of the other endpoint of a
250 <para>In case of
"active" sources, the output file name must
251 always be given explicitly and only
<constant>none
</constant>
252 is allowed.
</para></listitem>
256 <term><option>--compress
</option></term>
257 <term><option>--no-compress
</option></term>
259 <listitem><para>Compress or not, respectively, the data in the
260 journal using XZ.
</para></listitem>
264 <term><option>--seal
</option></term>
265 <term><option>--no-seal
</option></term>
267 <listitem><para>Periodically sign or not, respectively, the
268 data in the journal using Forward Secure Sealing.
273 <term><option>--getter=
<replaceable>PROG --option1 --option2
</replaceable></option></term>
275 <listitem><para>Program to invoke to retrieve data. The journal
276 event stream must be generated on standard output.
</para>
278 <para>Examples:
</para>
280 <programlisting>--getter='curl
"-HAccept: application/vnd.fdo.journal" https://some.host:
19531/'
</programlisting>
282 <programlisting>--getter='wget
--header=
"Accept: application/vnd.fdo.journal" -O- https://some.host:
19531/'
</programlisting>
286 <xi:include href=
"standard-options.xml" xpointer=
"help" />
287 <xi:include href=
"standard-options.xml" xpointer=
"version" />
292 <title>Examples
</title>
293 <para>Copy local journal events to a different journal directory:
295 journalctl -o export | systemd-journal-remote -o /tmp/dir -
299 <para>Retrieve events from a remote
300 <citerefentry><refentrytitle>systemd-journal-gatewayd
</refentrytitle><manvolnum>8</manvolnum></citerefentry>
301 instance and store them in
302 <filename>/var/log/journal/some.host/remote-some~host.journal
</filename>:
304 systemd-journal-remote --url http://some.host:
19531/
310 <title>See Also
</title>
312 <citerefentry><refentrytitle>systemd-journal-upload
</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
313 <citerefentry><refentrytitle>journalctl
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
314 <citerefentry><refentrytitle>systemd-journald.service
</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
315 <citerefentry><refentrytitle>systemd-journal-gatewayd.service
</refentrytitle><manvolnum>8</manvolnum></citerefentry>
316 <citerefentry><refentrytitle>journal-remote.conf
</refentrytitle><manvolnum>5</manvolnum></citerefentry>