]>
Commit | Line | Data |
---|---|---|
3802a3d3 | 1 | <?xml version='1.0'?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*--> |
fdfccdbc | 2 | <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" |
12b42c76 | 3 | "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> |
fdfccdbc ZJS |
4 | |
5 | <!-- | |
b975b0d5 | 6 | This file is part of systemd. |
fdfccdbc | 7 | |
b975b0d5 | 8 | Copyright 2012 Zbigniew Jędrzejewski-Szmek |
fdfccdbc | 9 | |
b975b0d5 ZJS |
10 | systemd is free software; you can redistribute it and/or modify it |
11 | under the terms of the GNU Lesser General Public License as published by | |
12 | the Free Software Foundation; either version 2.1 of the License, or | |
13 | (at your option) any later version. | |
fdfccdbc | 14 | |
b975b0d5 ZJS |
15 | systemd is distributed in the hope that it will be useful, but |
16 | WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
18 | Lesser General Public License for more details. | |
fdfccdbc | 19 | |
b975b0d5 ZJS |
20 | You should have received a copy of the GNU Lesser General Public License |
21 | along with systemd; If not, see <http://www.gnu.org/licenses/>. | |
fdfccdbc ZJS |
22 | --> |
23 | ||
0e8415f2 ZJS |
24 | <refentry id="systemd-journal-remote" conditional='HAVE_MICROHTTPD' |
25 | xmlns:xi="http://www.w3.org/2001/XInclude"> | |
fdfccdbc ZJS |
26 | |
27 | <refentryinfo> | |
28 | <title>systemd-journal-remote</title> | |
29 | <productname>systemd</productname> | |
30 | ||
31 | <authorgroup> | |
32 | <author> | |
33 | <contrib>Developer</contrib> | |
34 | <firstname>Zbigniew</firstname> | |
35 | <surname>Jędrzejewski-Szmek</surname> | |
36 | <email>zbyszek@in.waw.pl</email> | |
37 | </author> | |
38 | </authorgroup> | |
39 | </refentryinfo> | |
40 | ||
41 | <refmeta> | |
42 | <refentrytitle>systemd-journal-remote</refentrytitle> | |
43 | <manvolnum>8</manvolnum> | |
44 | </refmeta> | |
45 | ||
46 | <refnamediv> | |
47 | <refname>systemd-journal-remote</refname> | |
330427e2 | 48 | <refpurpose>Receive journal messages over the network</refpurpose> |
fdfccdbc ZJS |
49 | </refnamediv> |
50 | ||
51 | <refsynopsisdiv> | |
52 | <cmdsynopsis> | |
53 | <command>systemd-journal-remote</command> | |
54 | <arg choice="opt" rep="repeat">OPTIONS</arg> | |
330427e2 | 55 | <arg choice="opt" rep="norepeat">-o/--output=<replaceable>DIR</replaceable>|<replaceable>FILE</replaceable></arg> |
fdfccdbc ZJS |
56 | <arg choice="opt" rep="repeat">SOURCES</arg> |
57 | </cmdsynopsis> | |
58 | </refsynopsisdiv> | |
59 | ||
60 | <refsect1> | |
61 | <title>Description</title> | |
62 | ||
63 | <para> | |
64 | <filename>systemd-journal-remote</filename> is a command to | |
65 | receive serialized journal events and store them to the journal. | |
a8ca4722 | 66 | Input streams are in the |
28a0ad81 | 67 | <ulink url="https://www.freedesktop.org/wiki/Software/systemd/export"> |
fdfccdbc ZJS |
68 | Journal Export Format |
69 | </ulink>, | |
70 | i.e. like the output from | |
a8ca4722 ZJS |
71 | <command>journalctl --output=export</command>. For transport over |
72 | the network, this serialized stream is usually carried over an | |
73 | HTTPS connection. | |
fdfccdbc ZJS |
74 | </para> |
75 | </refsect1> | |
76 | ||
77 | <refsect1> | |
78 | <title>Sources</title> | |
79 | ||
80 | <para> | |
81 | Sources can be either "active" | |
82 | (<command>systemd-journal-remote</command> requests and pulls | |
83 | the data), or "passive" | |
84 | (<command>systemd-journal-remote</command> waits for a | |
dca348bc | 85 | connection and then receives events pushed by the other side). |
fdfccdbc ZJS |
86 | </para> |
87 | ||
88 | <para> | |
89 | <command>systemd-journal-remote</command> can read more than one | |
90 | event stream at a time. They will be interleaved in the output | |
91 | file. In case of "active" connections, each "source" is one | |
b8bde116 | 92 | stream, and in case of "passive" connections, each connection can |
fdfccdbc ZJS |
93 | result in a separate stream. Sockets can be configured in |
94 | "accept" mode (i.e. only one connection), or "listen" mode (i.e. | |
95 | multiple connections, each resulting in a stream). | |
96 | </para> | |
97 | ||
98 | <para> | |
99 | When there are no more connections, and no more can be created | |
100 | (there are no listening sockets), then | |
101 | <command>systemd-journal-remote</command> will exit. | |
102 | </para> | |
103 | ||
104 | <para>Active sources can be specified in the following | |
105 | ways:</para> | |
106 | ||
107 | <variablelist> | |
108 | <varlistentry> | |
c298b083 YW |
109 | <term><arg choice="opt" rep="repeat">SOURCES</arg></term> |
110 | ||
fdfccdbc ZJS |
111 | <listitem><para>When <option>-</option> is given as a |
112 | positional argument, events will be read from standard input. | |
113 | Other positional arguments will be treated as filenames | |
114 | to open and read from.</para></listitem> | |
115 | </varlistentry> | |
116 | ||
117 | <varlistentry> | |
118 | <term><option>--url=<replaceable>ADDRESS</replaceable></option></term> | |
119 | ||
120 | <listitem><para>With the | |
121 | <option>--url=<replaceable>ADDRESS</replaceable></option> option, | |
122 | events will be retrieved using HTTP from | |
123 | <replaceable>ADDRESS</replaceable>. This URL should refer to the | |
124 | root of a remote | |
125 | <citerefentry><refentrytitle>systemd-journal-gatewayd</refentrytitle><manvolnum>8</manvolnum></citerefentry> | |
de87760f YW |
126 | instance, e.g. http://some.host:19531/ or |
127 | https://some.host:19531/.</para></listitem> | |
fdfccdbc | 128 | </varlistentry> |
c298b083 YW |
129 | |
130 | <varlistentry> | |
131 | <term><option>--getter='<replaceable>PROG</replaceable> <arg choice="opt" rep="repeat">OPTIONS</arg>'</option></term> | |
132 | ||
133 | <listitem><para>Program to invoke to retrieve data. The journal | |
134 | event stream must be generated on standard output.</para> | |
135 | ||
136 | <para>Examples:</para> | |
137 | ||
138 | <programlisting>--getter='curl "-HAccept: application/vnd.fdo.journal" https://some.host:19531/'</programlisting> | |
139 | ||
140 | <programlisting>--getter='wget --header="Accept: application/vnd.fdo.journal" -O- https://some.host:19531/'</programlisting> | |
141 | </listitem> | |
142 | </varlistentry> | |
fdfccdbc ZJS |
143 | </variablelist> |
144 | ||
145 | <para>Passive sources can be specified in the following | |
146 | ways:</para> | |
147 | ||
148 | <variablelist> | |
149 | <varlistentry> | |
150 | <term><option>--listen-raw=<replaceable>ADDRESS</replaceable></option></term> | |
151 | ||
cc64d017 | 152 | <listitem><para><replaceable>ADDRESS</replaceable> must be an |
dca348bc | 153 | address suitable for <option>ListenStream=</option> (cf. |
fdfccdbc ZJS |
154 | <citerefentry><refentrytitle>systemd.socket</refentrytitle><manvolnum>5</manvolnum></citerefentry>). |
155 | <command>systemd-journal-remote</command> will listen on this | |
156 | socket for connections. Each connection is expected to be a | |
157 | stream of journal events.</para> | |
158 | </listitem> | |
159 | </varlistentry> | |
160 | ||
cc64d017 ZJS |
161 | <varlistentry> |
162 | <term><option>--listen-http=<replaceable>ADDRESS</replaceable></option></term> | |
163 | <term><option>--listen-https=<replaceable>ADDRESS</replaceable></option></term> | |
164 | ||
8a8d55f2 ZJS |
165 | <listitem><para><replaceable>ADDRESS</replaceable> must be |
166 | either a negative integer, in which case it will be | |
167 | interpreted as the (negated) file descriptor number, or an | |
cc64d017 ZJS |
168 | address suitable for <option>ListenStream=</option> (c.f. |
169 | <citerefentry><refentrytitle>systemd.socket</refentrytitle><manvolnum>5</manvolnum></citerefentry>). | |
8a8d55f2 ZJS |
170 | In the first case, matching file descriptor must be inherited |
171 | through | |
172 | <varname>$LISTEN_FDS</varname>/<varname>$LISTEN_PID</varname>. | |
173 | In the second case, an HTTP or HTTPS server will be spawned on | |
174 | this port, respectively for <option>--listen-http</option> and | |
ff9b60f3 | 175 | <option>--listen-https</option>. Currently, only POST requests |
8a8d55f2 ZJS |
176 | to <filename>/upload</filename> with <literal>Content-Type: |
177 | application/vnd.fdo.journal</literal> are supported.</para> | |
cc64d017 ZJS |
178 | </listitem> |
179 | </varlistentry> | |
180 | ||
fdfccdbc ZJS |
181 | <varlistentry> |
182 | <term><varname>$LISTEN_FDS</varname></term> | |
183 | ||
184 | <listitem><para><command>systemd-journal-remote</command> | |
185 | supports the | |
186 | <varname>$LISTEN_FDS</varname>/<varname>$LISTEN_PID</varname> | |
8a8d55f2 ZJS |
187 | protocol. Open sockets inherited through socket activation |
188 | behave like those opened with <option>--listen-raw=</option> | |
189 | described above, unless they are specified as an argument in | |
190 | <option>--listen-http=-<replaceable>n</replaceable></option> | |
191 | or | |
192 | <option>--listen-https=-<replaceable>n</replaceable></option> | |
b8bde116 | 193 | above. In the latter case, an HTTP or HTTPS server will be |
8a8d55f2 ZJS |
194 | spawned using this descriptor and connections must be made |
195 | over the HTTP protocol.</para> | |
fdfccdbc ZJS |
196 | </listitem> |
197 | </varlistentry> | |
198 | ||
199 | </variablelist> | |
200 | </refsect1> | |
201 | ||
202 | <refsect1> | |
203 | <title>Sinks</title> | |
204 | ||
205 | <para>The location of the output journal can be specified | |
e64aae43 | 206 | with <option>-o</option> or <option>--output=</option>. |
fdfccdbc ZJS |
207 | </para> |
208 | ||
209 | <variablelist> | |
210 | <varlistentry> | |
211 | <term><option>--output=<replaceable>FILE</replaceable></option></term> | |
212 | ||
a8ca4722 ZJS |
213 | <listitem><para>Will write to this journal file. The filename |
214 | must end with <filename>.journal</filename>. The file will be | |
215 | created if it does not exist. If necessary (journal file full, | |
216 | or corrupted), the file will be renamed following normal | |
dca348bc JE |
217 | journald rules and a new journal file will be created in its |
218 | stead.</para></listitem> | |
fdfccdbc ZJS |
219 | </varlistentry> |
220 | ||
221 | <varlistentry> | |
222 | <term><option>--output=<replaceable>DIR</replaceable></option></term> | |
223 | ||
224 | <listitem><para>Will create journal files underneath directory | |
b8bde116 JE |
225 | <replaceable>DIR</replaceable>. The directory must exist. If |
226 | necessary (journal files over size, or corrupted), journal | |
fdfccdbc ZJS |
227 | files will be rotated following normal journald rules. Names |
228 | of files underneath <replaceable>DIR</replaceable> will be | |
229 | generated using the rules described below.</para></listitem> | |
230 | </varlistentry> | |
231 | </variablelist> | |
232 | ||
a8ca4722 ZJS |
233 | <para>If <option>--output=</option> is not used, the output |
234 | directory <filename>/var/log/journal/remote/</filename> will be | |
235 | used. In case the output file is not specified, journal files | |
236 | will be created underneath the selected directory. Files will be | |
237 | called | |
238 | <filename>remote-<replaceable>hostname</replaceable>.journal</filename>, | |
cbfaff65 | 239 | where the <replaceable>hostname</replaceable> part is the |
a8ca4722 ZJS |
240 | escaped hostname of the source endpoint of the connection, or the |
241 | numerical address if the hostname cannot be determined.</para> | |
242 | ||
c298b083 YW |
243 | <para>In the case that "active" sources are given by the positional |
244 | arguments or <option>--getter=</option> option, the output file name | |
245 | must always be given explicitly.</para> | |
fdfccdbc ZJS |
246 | </refsect1> |
247 | ||
248 | <refsect1> | |
249 | <title>Options</title> | |
250 | ||
251 | <para>The following options are understood:</para> | |
252 | ||
253 | <variablelist> | |
8201af08 ZJS |
254 | <varlistentry> |
255 | <term><option>--split-mode</option></term> | |
256 | ||
257 | <listitem><para>One of <constant>none</constant> or | |
258 | <constant>host</constant>. For the first, only one output | |
259 | journal file is used. For the latter, a separate output file | |
260 | is used, based on the hostname of the other endpoint of a | |
261 | connection.</para> | |
262 | ||
e64aae43 YW |
263 | <para>In the case that "active" sources are given by the positional |
264 | arguments or <option>--getter=</option> option, the output file name must | |
8201af08 ZJS |
265 | always be given explicitly and only <constant>none</constant> |
266 | is allowed.</para></listitem> | |
267 | </varlistentry> | |
268 | ||
fdfccdbc | 269 | <varlistentry> |
6f157e4e | 270 | <term><option>--compress</option> [<replaceable>BOOL</replaceable>]</term> |
fdfccdbc | 271 | |
6f157e4e DD |
272 | <listitem><para>If this is set to <literal>yes</literal> then compress |
273 | the data in the journal using XZ. The default is <literal>yes</literal>. | |
274 | </para></listitem> | |
fdfccdbc ZJS |
275 | </varlistentry> |
276 | ||
277 | <varlistentry> | |
6f157e4e | 278 | <term><option>--seal</option> [<replaceable>BOOL</replaceable>]</term> |
fdfccdbc | 279 | |
6f157e4e DD |
280 | <listitem><para>If this is set to <literal>yes</literal> then |
281 | periodically sign the data in the journal using Forward Secure Sealing. | |
282 | The default is <literal>no</literal>.</para></listitem> | |
fdfccdbc ZJS |
283 | </varlistentry> |
284 | ||
0e8415f2 ZJS |
285 | <xi:include href="standard-options.xml" xpointer="help" /> |
286 | <xi:include href="standard-options.xml" xpointer="version" /> | |
fdfccdbc ZJS |
287 | </variablelist> |
288 | </refsect1> | |
289 | ||
290 | <refsect1> | |
291 | <title>Examples</title> | |
292 | <para>Copy local journal events to a different journal directory: | |
293 | <programlisting> | |
c298b083 | 294 | journalctl -o export | systemd-journal-remote -o /tmp/dir/foo.journal - |
fdfccdbc ZJS |
295 | </programlisting> |
296 | </para> | |
297 | ||
e6b6225e | 298 | <para>Retrieve all available events from a remote |
fdfccdbc ZJS |
299 | <citerefentry><refentrytitle>systemd-journal-gatewayd</refentrytitle><manvolnum>8</manvolnum></citerefentry> |
300 | instance and store them in | |
e6b6225e | 301 | <filename>/var/log/journal/remote/remote-some.host.journal</filename>: |
fdfccdbc ZJS |
302 | <programlisting> |
303 | systemd-journal-remote --url http://some.host:19531/ | |
304 | </programlisting> | |
305 | </para> | |
e6b6225e YW |
306 | |
307 | <para>Retrieve current boot events and wait for new events from a remote | |
308 | <citerefentry><refentrytitle>systemd-journal-gatewayd</refentrytitle><manvolnum>8</manvolnum></citerefentry> | |
309 | instance, and store them in | |
310 | <filename>/var/log/journal/remote/remote-some.host.journal</filename>: | |
311 | <programlisting> | |
312 | systemd-journal-remote --url http://some.host:19531/entries?boot&follow | |
313 | </programlisting> | |
314 | </para> | |
315 | </refsect1> | |
fdfccdbc ZJS |
316 | |
317 | <refsect1> | |
318 | <title>See Also</title> | |
319 | <para> | |
330427e2 | 320 | <citerefentry><refentrytitle>systemd-journal-upload</refentrytitle><manvolnum>8</manvolnum></citerefentry>, |
fdfccdbc ZJS |
321 | <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>, |
322 | <citerefentry><refentrytitle>systemd-journald.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>, | |
330427e2 | 323 | <citerefentry><refentrytitle>systemd-journal-gatewayd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry> |
eaa5251d | 324 | <citerefentry><refentrytitle>journal-remote.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry> |
fdfccdbc ZJS |
325 | </para> |
326 | </refsect1> | |
327 | </refentry> |