]> git.proxmox.com Git - systemd.git/blame - man/systemd-cat.html
Imported Upstream version 208
[systemd.git] / man / systemd-cat.html
CommitLineData
663996b3
MS
1<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>systemd-cat</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><style>
2 a.headerlink {
3 color: #c60f0f;
4 font-size: 0.8em;
5 padding: 0 4px 0 4px;
6 text-decoration: none;
7 visibility: hidden;
8 }
9
10 a.headerlink:hover {
11 background-color: #c60f0f;
12 color: white;
13 }
14
15 h1:hover > a.headerlink, h2:hover > a.headerlink, h3:hover > a.headerlink, dt:hover > a.headerlink {
16 visibility: visible;
17 }
18 </style><a href="index.html">Index </a>·
19 <a href="systemd.directives.html">Directives </a>·
20 <a href="../python-systemd/index.html">Python </a>·
21 <a href="../libudev/index.html">libudev </a>·
14228c0d 22 <a href="../libudev/index.html">gudev </a><span style="float:right">systemd 208</span><hr><div class="refentry"><a name="systemd-cat"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>systemd-cat — Connect a pipeline or program's output with the journal</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">systemd-cat [OPTIONS...] [COMMAND] [ARGUMENTS...]</code> </p></div><div class="cmdsynopsis"><p><code class="command">systemd-cat [OPTIONS...]</code> </p></div></div><div class="refsect1"><a name="idm274700570000"></a><h2 id="Description">Description<a class="headerlink" title="Permalink to this headline" href="#Description">¶</a></h2><p><span class="command"><strong>systemd-cat</strong></span> may be used to
663996b3
MS
23 connect STDOUT and STDERR of a process with the
24 journal, or as a filter tool in a shell pipeline to
25 pass the output the previous pipeline element
14228c0d 26 generates to the journal.</p><p>If no parameter is passed,
663996b3 27 <span class="command"><strong>systemd-cat</strong></span> will write
14228c0d 28 everything it reads from standard input (STDIN) to the journal.</p><p>If parameters are passed, they are executed as
663996b3
MS
29 command line with standard output (STDOUT) and standard
30 error output (STDERR) connected to the journal, so
14228c0d 31 that all it writes is stored in the journal.</p></div><div class="refsect1"><a name="idm274700566160"></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="-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>Prints a short help
663996b3
MS
32 text and exits.</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>Prints a short version
33 string and exits.</p></dd><dt id="-t"><span class="term"><code class="option">-t</code>, </span><span class="term"><code class="option">--identifier=</code></span><a class="headerlink" title="Permalink to this term" href="#-t">¶</a></dt><dd><p>Specify a short string
34 that is used to identify the logging
14228c0d 35 tool. If not specified, no identification
663996b3
MS
36 string is written to the journal.</p></dd><dt id="-p"><span class="term"><code class="option">-p</code>, </span><span class="term"><code class="option">--priority=</code></span><a class="headerlink" title="Permalink to this term" href="#-p">¶</a></dt><dd><p>Specify the default
37 priority level for the logged
38 messages. Pass one of
14228c0d
MB
39 "<code class="literal">emerg</code>",
40 "<code class="literal">alert</code>",
41 "<code class="literal">crit</code>",
42 "<code class="literal">err</code>",
43 "<code class="literal">warning</code>",
44 "<code class="literal">notice</code>",
45 "<code class="literal">info</code>",
46 "<code class="literal">debug</code>", or a
663996b3
MS
47 value between 0 and 7 (corresponding
48 to the same named levels). These
49 priority values are the same as
50 defined by
51 <a href="syslog.html"><span class="citerefentry"><span class="refentrytitle">syslog</span>(3)</span></a>. Defaults
14228c0d 52 to "<code class="literal">info</code>". Note that
663996b3
MS
53 this simply controls the default,
54 individual lines may be logged with
55 different levels if they are prefixed
56 accordingly. For details see
57 <code class="option">--level-prefix=</code>
58 below.</p></dd><dt id="--level-prefix="><span class="term"><code class="option">--level-prefix=</code></span><a class="headerlink" title="Permalink to this term" href="#--level-prefix=">¶</a></dt><dd><p>Controls whether lines
59 read are parsed for syslog priority
60 level prefixes. If enabled (the
14228c0d 61 default), a line prefixed with a
663996b3 62 priority prefix such as
14228c0d 63 "<code class="literal">&lt;5&gt;</code>" is logged
663996b3 64 at priority 5
14228c0d 65 ("<code class="literal">notice</code>"), and
663996b3
MS
66 similar for the other priority
67 levels. Takes a boolean
14228c0d
MB
68 argument.</p></dd></dl></div></div><div class="refsect1"><a name="idm274704441952"></a><h2 id="Exit status">Exit status<a class="headerlink" title="Permalink to this headline" href="#Exit%20status">¶</a></h2><p>On success 0 is returned, a non-zero failure
69 code otherwise.</p></div><div class="refsect1"><a name="idm274704440768"></a><h2 id="Examples">Examples<a class="headerlink" title="Permalink to this headline" href="#Examples">¶</a></h2><div class="example"><a name="idm274704440096"></a><p class="title"><b>Example 1. Invoke a program</b></p><div class="example-contents"><p>This calls <code class="filename">/bin/ls</code>
663996b3 70 with STDOUT/STDERR connected to the
14228c0d 71 journal:</p><pre class="programlisting"># systemd-cat ls</pre></div></div><br class="example-break"><div class="example"><a name="idm274704429952"></a><p class="title"><b>Example 2. Usage in a shell pipeline</b></p><div class="example-contents"><p>This builds a shell pipeline also
663996b3
MS
72 invoking <code class="filename">/bin/ls</code> and
73 writes the output it generates to the
74 journal:</p><pre class="programlisting"># ls | systemd-cat</pre></div></div><br class="example-break"><p>Even though the two examples have very similar
75 effects the first is preferable since only one process
76 is running at a time, and both STDOUT and STDERR are
77 captured while in the second example only STDOUT is
14228c0d 78 captured.</p></div><div class="refsect1"><a name="idm274704426448"></a><h2 id="See Also">See Also<a class="headerlink" title="Permalink to this headline" href="#See%20Also">¶</a></h2><p>
663996b3
MS
79 <a href="systemd.html"><span class="citerefentry"><span class="refentrytitle">systemd</span>(1)</span></a>,
80 <a href="systemctl.html"><span class="citerefentry"><span class="refentrytitle">systemctl</span>(1)</span></a>,
81 <a href="logger.html"><span class="citerefentry"><span class="refentrytitle">logger</span>(1)</span></a>
82 </p></div></div></body></html>