mirror of
https://git.proxmox.com/git/systemd
synced 2025-07-24 17:23:04 +00:00
141 lines
14 KiB
HTML
141 lines
14 KiB
HTML
<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 219</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 — Receive 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=<em class="replaceable"><code>DIR</code></em>|<em class="replaceable"><code>FILE</code></em>] [SOURCES...]</p></div></div><div class="refsect1"><a name="idm140254079057152"></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 are 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>. For transport over
|
|
the network, this serialized stream is usually carried over an
|
|
HTTPS connection.
|
|
</p></div><div class="refsect1"><a name="idm140254079053632"></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="idm140254082970112"></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>. For "active"
|
|
sources, this option is required.
|
|
</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 file. 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/remote/</code> will be
|
|
used. 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>hostname</code></em>.journal</code>,
|
|
where the <em class="replaceable"><code>hostname</code></em> part is the
|
|
escaped hostname of the source endpoint of the connection, or the
|
|
numerical address if the hostname cannot be determined.</p><p>In case of "active" sources, the output file name must
|
|
always be given explicitly.</p></div><div class="refsect1"><a name="idm140254082958464"></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="--split-mode"><span class="term"><code class="option">--split-mode</code></span><a class="headerlink" title="Permalink to this term" href="#--split-mode">¶</a></dt><dd><p>One of <code class="constant">none</code> or
|
|
<code class="constant">host</code>. For the first, only one output
|
|
journal file is used. For the latter, a separate output file
|
|
is used, based on the hostname of the other endpoint of a
|
|
connection.</p><p>In case of "active" sources, the output file name must
|
|
always be given explicitly and only <code class="constant">none</code>
|
|
is allowed.</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><dt id="-h"><span class="term"><code class="option">-h</code>, </span><span class="term"><code class="option">--help</code></span><a class="headerlink" title="Permalink to this term" href="#-h">¶</a></dt><dd><p><a name="help-text"></a>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><a name="version-text"></a>Print a short version string and exit.</p></dd></dl></div></div><div class="refsect1"><a name="idm140254077978496"></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="idm140254077974160"></a><h2 id="See Also">See Also<a class="headerlink" title="Permalink to this headline" href="#See%20Also">¶</a></h2><p>
|
|
<a href="systemd-journal-upload.html"><span class="citerefentry"><span class="refentrytitle">systemd-journal-upload</span>(8)</span></a>,
|
|
<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>
|