1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137
|
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>systemd-journal-remote</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><style>
a.headerlink {
color: #c60f0f;
font-size: 0.8em;
padding: 0 4px 0 4px;
text-decoration: none;
visibility: hidden;
}
a.headerlink:hover {
background-color: #c60f0f;
color: white;
}
h1:hover > a.headerlink, h2:hover > a.headerlink, h3:hover > a.headerlink, dt:hover > a.headerlink {
visibility: visible;
}
</style><a href="index.html">Index </a>·
<a href="systemd.directives.html">Directives </a>·
<a href="../python-systemd/index.html">Python </a>·
<a href="../libudev/index.html">libudev </a>·
<a href="../libudev/index.html">gudev </a><span style="float:right">systemd 215</span><hr><div class="refentry"><a name="systemd-journal-remote"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>systemd-journal-remote — Stream journal messages over the network</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">systemd-journal-remote</code> [OPTIONS...] [-o/--output=DIR|FILE] [SOURCES...]</p></div></div><div class="refsect1"><a name="idm214192157056"></a><h2 id="Description">Description<a class="headerlink" title="Permalink to this headline" href="#Description">¶</a></h2><p>
<code class="filename">systemd-journal-remote</code> is a command to
receive serialized journal events and store them to the journal.
Input streams must be in the
<a class="ulink" href="http://www.freedesktop.org/wiki/Software/systemd/export" target="_top">
Journal Export Format
</a>,
i.e. like the output from
<span class="command"><strong>journalctl --output=export</strong></span>.
</p></div><div class="refsect1"><a name="idm214188367888"></a><h2 id="Sources">Sources<a class="headerlink" title="Permalink to this headline" href="#Sources">¶</a></h2><p>
Sources can be either "active"
(<span class="command"><strong>systemd-journal-remote</strong></span> requests and pulls
the data), or "passive"
(<span class="command"><strong>systemd-journal-remote</strong></span> waits for a
connection and then receives events pushed by the other side).
</p><p>
<span class="command"><strong>systemd-journal-remote</strong></span> can read more than one
event stream at a time. They will be interleaved in the output
file. In case of "active" connections, each "source" is one
stream, and in case of "passive" connections, each connection can
result in a separate stream. Sockets can be configured in
"accept" mode (i.e. only one connection), or "listen" mode (i.e.
multiple connections, each resulting in a stream).
</p><p>
When there are no more connections, and no more can be created
(there are no listening sockets), then
<span class="command"><strong>systemd-journal-remote</strong></span> will exit.
</p><p>Active sources can be specified in the following
ways:</p><div class="variablelist"><dl class="variablelist"><dt id=""><a class="headerlink" title="Permalink to this term" href="#">¶</a></dt><dd><p>When <code class="option">-</code> is given as a
positional argument, events will be read from standard input.
Other positional arguments will be treated as filenames
to open and read from.</p></dd><dt id="--url=ADDRESS"><span class="term"><code class="option">--url=<em class="replaceable"><code>ADDRESS</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--url=ADDRESS">¶</a></dt><dd><p>With the
<code class="option">--url=<em class="replaceable"><code>ADDRESS</code></em></code> option,
events will be retrieved using HTTP from
<em class="replaceable"><code>ADDRESS</code></em>. This URL should refer to the
root of a remote
<a href="systemd-journal-gatewayd.html"><span class="citerefentry"><span class="refentrytitle">systemd-journal-gatewayd</span>(8)</span></a>
instance (e.g. <a class="ulink" href="" target="_top">http://some.host:19531/</a> or
<a class="ulink" href="" target="_top">https://some.host:19531/</a>).</p></dd></dl></div><p>Passive sources can be specified in the following
ways:</p><div class="variablelist"><dl class="variablelist"><dt id="--listen-raw=ADDRESS"><span class="term"><code class="option">--listen-raw=<em class="replaceable"><code>ADDRESS</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--listen-raw=ADDRESS">¶</a></dt><dd><p><em class="replaceable"><code>ADDRESS</code></em> must be an
address suitable for <code class="option">ListenStream=</code> (cf.
<a href="systemd.socket.html"><span class="citerefentry"><span class="refentrytitle">systemd.socket</span>(5)</span></a>).
<span class="command"><strong>systemd-journal-remote</strong></span> will listen on this
socket for connections. Each connection is expected to be a
stream of journal events.</p></dd><dt id="--listen-http=ADDRESS"><span class="term"><code class="option">--listen-http=<em class="replaceable"><code>ADDRESS</code></em></code>, </span><span class="term"><code class="option">--listen-https=<em class="replaceable"><code>ADDRESS</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--listen-http=ADDRESS">¶</a></dt><dd><p><em class="replaceable"><code>ADDRESS</code></em> must be
either a negative integer, in which case it will be
interpreted as the (negated) file descriptor number, or an
address suitable for <code class="option">ListenStream=</code> (c.f.
<a href="systemd.socket.html"><span class="citerefentry"><span class="refentrytitle">systemd.socket</span>(5)</span></a>).
In the first case, matching file descriptor must be inherited
through
<code class="varname">$LISTEN_FDS</code>/<code class="varname">$LISTEN_PID</code>.
In the second case, an HTTP or HTTPS server will be spawned on
this port, respectively for <code class="option">--listen-http</code> and
<code class="option">--listen-https</code>. Currenntly, only POST requests
to <code class="filename">/upload</code> with "<code class="literal">Content-Type:
application/vnd.fdo.journal</code>" are supported.</p></dd><dt id="$LISTEN_FDS"><span class="term"><code class="varname">$LISTEN_FDS</code></span><a class="headerlink" title="Permalink to this term" href="#%24LISTEN_FDS">¶</a></dt><dd><p><span class="command"><strong>systemd-journal-remote</strong></span>
supports the
<code class="varname">$LISTEN_FDS</code>/<code class="varname">$LISTEN_PID</code>
protocol. Open sockets inherited through socket activation
behave like those opened with <code class="option">--listen-raw=</code>
described above, unless they are specified as an argument in
<code class="option">--listen-http=-<em class="replaceable"><code>n</code></em></code>
or
<code class="option">--listen-https=-<em class="replaceable"><code>n</code></em></code>
above. In the latter case, an HTTP or HTTPS server will be
spawned using this descriptor and connections must be made
over the HTTP protocol.</p></dd></dl></div></div><div class="refsect1"><a name="idm214192241888"></a><h2 id="Sinks">Sinks<a class="headerlink" title="Permalink to this headline" href="#Sinks">¶</a></h2><p>The location of the output journal can be specified
with <code class="option">-o</code> or <code class="option">--output=</code>.
</p><div class="variablelist"><dl class="variablelist"><dt id="--output=FILE"><span class="term"><code class="option">--output=<em class="replaceable"><code>FILE</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--output=FILE">¶</a></dt><dd><p>Will write to this journal. The filename must
end with <code class="filename">.journal</code>. The file will be
created if it does not exist. If necessary (journal file
full, or corrupted), the file will be renamed following normal
journald rules and a new journal file will be created in its
stead.</p></dd><dt id="--output=DIR"><span class="term"><code class="option">--output=<em class="replaceable"><code>DIR</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--output=DIR">¶</a></dt><dd><p>Will create journal files underneath directory
<em class="replaceable"><code>DIR</code></em>. The directory must exist. If
necessary (journal files over size, or corrupted), journal
files will be rotated following normal journald rules. Names
of files underneath <em class="replaceable"><code>DIR</code></em> will be
generated using the rules described below.</p></dd></dl></div><p>If <code class="option">--output=</code> is not used, the output directory
<code class="filename">/var/log/journal/<em class="replaceable"><code>machine-id</code></em>/</code>
will be used, where <em class="replaceable"><code>machine-id</code></em> is the
identifier of the current system (see
<a href="machine-id.html"><span class="citerefentry"><span class="refentrytitle">machine-id</span>(5)</span></a>).
In case the output file is not specified, journal files will be
created underneath the selected directory. Files will be called
<code class="filename">remote-<em class="replaceable"><code>variable</code></em>.journal</code>,
where the <em class="replaceable"><code>variable</code></em> part is generated
based on what passive and active sources are specified. It is
recommended to give a full output filename.</p><p>In case of "active" sources, if the hostname is known, it
will be used in the <em class="replaceable"><code>variable</code></em> part.
Otherwise, local address and port number will be used, or
"<code class="literal">stdin</code>" for events passed over standard
input, and "<code class="literal">multiple</code>" if more than one source
is specified.</p></div><div class="refsect1"><a name="idm214192219344"></a><h2 id="Options">Options<a class="headerlink" title="Permalink to this headline" href="#Options">¶</a></h2><p>The following options are understood:</p><div class="variablelist"><dl class="variablelist"><dt id="--help"><span class="term"><code class="option">--help</code>, </span><span class="term"><code class="option">-h</code></span><a class="headerlink" title="Permalink to this term" href="#--help">¶</a></dt><dd><p>Print a short help
text and exit.</p></dd><dt id="--version"><span class="term"><code class="option">--version</code></span><a class="headerlink" title="Permalink to this term" href="#--version">¶</a></dt><dd><p>Print a short version
string and exit.</p></dd><dt id="--compress"><span class="term"><code class="option">--compress</code>, </span><span class="term"><code class="option">--no-compress</code></span><a class="headerlink" title="Permalink to this term" href="#--compress">¶</a></dt><dd><p>Compress or not, respectively, the data in the
journal using XZ.</p></dd><dt id="--seal"><span class="term"><code class="option">--seal</code>, </span><span class="term"><code class="option">--no-seal</code></span><a class="headerlink" title="Permalink to this term" href="#--seal">¶</a></dt><dd><p>Periodically sign or not, respectively, the
data in the journal using Forward Secure Sealing.
</p></dd><dt id="--getter=PROG --option1 --option2"><span class="term"><code class="option">--getter=<em class="replaceable"><code>PROG --option1 --option2</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--getter=PROG%20--option1%20--option2">¶</a></dt><dd><p>Program to invoke to retrieve data. The journal
event stream must be generated on standard output.</p><p>Examples:</p><pre class="programlisting">--getter='curl "-HAccept: application/vnd.fdo.journal" https://some.host:19531/'</pre><pre class="programlisting">--getter='wget --header="Accept: application/vnd.fdo.journal" -O- https://some.host:19531/'</pre></dd></dl></div></div><div class="refsect1"><a name="idm214187575664"></a><h2 id="Examples">Examples<a class="headerlink" title="Permalink to this headline" href="#Examples">¶</a></h2><p>Copy local journal events to a different journal directory:
</p><pre class="programlisting">
journalctl -o export | systemd-journal-remote -o /tmp/dir -
</pre><p>
</p><p>Retrieve events from a remote
<a href="systemd-journal-gatewayd.html"><span class="citerefentry"><span class="refentrytitle">systemd-journal-gatewayd</span>(8)</span></a>
instance and store them in
<code class="filename">/var/log/journal/some.host/remote-some~host.journal</code>:
</p><pre class="programlisting">
systemd-journal-remote --url http://some.host:19531/
</pre><p>
</p></div><div class="refsect1"><a name="idm214187571248"></a><h2 id="See Also">See Also<a class="headerlink" title="Permalink to this headline" href="#See%20Also">¶</a></h2><p>
<a href="journalctl.html"><span class="citerefentry"><span class="refentrytitle">journalctl</span>(1)</span></a>,
<a href="systemd-journald.service.html"><span class="citerefentry"><span class="refentrytitle">systemd-journald.service</span>(8)</span></a>,
<a href="systemd-journal-gatewayd.service.html"><span class="citerefentry"><span class="refentrytitle">systemd-journal-gatewayd.service</span>(8)</span></a>.
</p></div></div></body></html>
|