systemd-journal-gatewayd.socket.html 11.9 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>systemd-journal-gatewayd.service</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>·
22
  <a href="../libudev/index.html">gudev </a><span style="float:right">systemd 215</span><hr><div class="refentry"><a name="systemd-journal-gatewayd.service"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>systemd-journal-gatewayd.service, systemd-journal-gatewayd.socket, systemd-journal-gatewayd — HTTP server for journal events</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><p><code class="filename">systemd-journal-gatewayd.service</code></p><p><code class="filename">systemd-journal-gatewayd.socket</code></p><div class="cmdsynopsis"><p><code class="command">/usr/lib/systemd/systemd-journal-gatewayd</code>  [OPTIONS...]</p></div></div><div class="refsect1"><a name="idm214188770192"></a><h2 id="Description">Description<a class="headerlink" title="Permalink to this headline" href="#Description"></a></h2><p><span class="command"><strong>systemd-journal-gatewayd</strong></span> serves journal
23 24 25 26 27 28 29 30
    events over the network. Clients must connect using
    HTTP. The server listens on port 19531 by default.
    If <code class="option">--cert=</code> is specified, the server expects
    HTTPS connections.</p><p>The program is started by
    <a href="systemd.html"><span class="citerefentry"><span class="refentrytitle">systemd</span>(1)</span></a>
    and expects to receive a single socket. Use
    <span class="command"><strong>systemctl start systemd-journal-gatewayd.socket</strong></span> to start
    the service, and <span class="command"><strong>systemctl enable systemd-journal-gatewayd.socket</strong></span>
31
    to have it started on boot.</p></div><div class="refsect1"><a name="idm214184977408"></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="--cert="><span class="term"><code class="option">--cert=</code></span><a class="headerlink" title="Permalink to this term" href="#--cert="></a></dt><dd><p>Specify the path to a file containing a server
32 33 34 35 36
        certificate in PEM format. This option switches
        <span class="command"><strong>systemd-journal-gatewayd</strong></span> into HTTPS mode
        and must be used together with
        <code class="option">--key=</code>.</p></dd><dt id="--key="><span class="term"><code class="option">--key=</code></span><a class="headerlink" title="Permalink to this term" href="#--key="></a></dt><dd><p>Specify the path to a file containing a server
        key in PEM format corresponding to the certificate specified
37
        with <code class="option">--cert=</code>.</p></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.
38
    </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="idm214184969312"></a><h2 id="Supported URLs">Supported URLs<a class="headerlink" title="Permalink to this headline" href="#Supported%20URLs"></a></h2><p>The following URLs are recognized:</p><div class="variablelist"><dl class="variablelist"><dt id="/browse"><span class="term"><code class="uri">/browse</code></span><a class="headerlink" title="Permalink to this term" href="#/browse"></a></dt><dd><p>Interactive browsing.</p></dd><dt id="/entries[?option1&amp;option2=value...]"><span class="term"><code class="uri">/entries[?option1&amp;option2=value...]</code></span><a class="headerlink" title="Permalink to this term" href="#/entries%5B?option1&amp;option2=value...%5D"></a></dt><dd><p>Retrieval of events in various formats.</p><p>The <code class="option">Accept:</code> part of the HTTP header
39 40 41 42 43 44
        determines the format. Supported values are described below.
        </p><p>The <code class="option">Range:</code> part of the HTTP header
        determines the range of events returned. Supported values are
        described below.
        </p><p>GET parameters can be used to modify what events are
        returned. Supported parameters are described below.</p></dd><dt id="/machine"><span class="term"><code class="uri">/machine</code></span><a class="headerlink" title="Permalink to this term" href="#/machine"></a></dt><dd><p>Return a JSON structure describing the machine.</p><p>Example:
45
        </p><pre class="programlisting">{ "machine_id" : "8cf7ed9d451ea194b77a9f118f3dc446",
46 47 48 49
  "boot_id" : "3d3c9efaf556496a9b04259ee35df7f7",
  "hostname" : "fedora",
  "os_pretty_name" : "Fedora 19 (Rawhide)",
  "virtualization" : "kvm",
50
  ...}</pre><p>
51
        </p></dd><dt id="/fields/FIELD_NAME"><span class="term"><code class="uri">/fields/<em class="replaceable"><code>FIELD_NAME</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#/fields/FIELD_NAME"></a></dt><dd><p>Return a list of values of this field present in the logs.</p></dd></dl></div></div><div class="refsect1"><a name="idm214188863728"></a><h2 id="Accept header">Accept header<a class="headerlink" title="Permalink to this headline" href="#Accept%20header"></a></h2><p>
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
      <code class="option">Accept: <em class="replaceable"><code>format</code></em></code>
    </p><p>Recognized formats:</p><div class="variablelist"><dl class="variablelist"><dt id="text/plain"><span class="term"><code class="constant">text/plain</code></span><a class="headerlink" title="Permalink to this term" href="#text/plain"></a></dt><dd><p>The default. Plaintext syslog-like output,
        one line per journal entry
        (like <span class="command"><strong>journalctl --output short</strong></span>).</p></dd><dt id="application/json"><span class="term"><code class="constant">application/json</code></span><a class="headerlink" title="Permalink to this term" href="#application/json"></a></dt><dd><p>Entries are formatted as JSON data structures,
        one per line
        (like <span class="command"><strong>journalctl --output json</strong></span>).
        See <a class="ulink" href="http://www.freedesktop.org/wiki/Software/systemd/json" target="_top">Journal
        JSON Format</a> for more information.</p></dd><dt id="application/event-stream"><span class="term"><code class="constant">application/event-stream</code></span><a class="headerlink" title="Permalink to this term" href="#application/event-stream"></a></dt><dd><p>Entries are formatted as JSON data structures,
        wrapped in a format suitable for <a class="ulink" href="https://developer.mozilla.org/en-US/docs/Server-sent_events/Using_server-sent_events" target="_top">
        Server-Sent Events</a>
        (like <span class="command"><strong>journalctl --output json-sse</strong></span>).
        </p></dd><dt id="application/vnd.fdo.journal"><span class="term"><code class="constant">application/vnd.fdo.journal</code></span><a class="headerlink" title="Permalink to this term" href="#application/vnd.fdo.journal"></a></dt><dd><p>Entries are serialized into a binary (but
        mostly text-based) stream suitable for backups and network
        transfer
        (like <span class="command"><strong>journalctl --output export</strong></span>).
        See <a class="ulink" href="http://www.freedesktop.org/wiki/Software/systemd/export" target="_top">Journal
68
        Export Format</a> for more information.</p></dd></dl></div></div><div class="refsect1"><a name="idm214188842016"></a><h2 id="Range header">Range header<a class="headerlink" title="Permalink to this headline" href="#Range%20header"></a></h2><p>
69 70 71 72 73
      <code class="option">Range: entries=<em class="replaceable"><code>cursor</code></em>[[:<em class="replaceable"><code>num_skip</code></em>]:<em class="replaceable"><code>num_entries</code></em>]</code>
    </p><p>where
      <code class="option">cursor</code> is a cursor string,
      <code class="option">num_skip</code> is an integer,
      <code class="option">num_entries</code> is an unsigned integer.
74
    </p><p>Range defaults to all available events.</p></div><div class="refsect1"><a name="idm214188836848"></a><h2 id="URL GET parameters">URL GET parameters<a class="headerlink" title="Permalink to this headline" href="#URL%20GET%20parameters"></a></h2><p>Following parameters can be used as part of the URL:</p><div class="variablelist"><dl class="variablelist"><dt id="follow"><span class="term"><code class="uri">follow</code></span><a class="headerlink" title="Permalink to this term" href="#follow"></a></dt><dd><p>wait for new events
75 76 77 78
        (like <span class="command"><strong>journalctl --follow</strong></span>, except that
        the number of events returned is not limited).</p></dd><dt id="discrete"><span class="term"><code class="uri">discrete</code></span><a class="headerlink" title="Permalink to this term" href="#discrete"></a></dt><dd><p>Test that the specified cursor refers to an
        entry in the journal. Returns just this entry.</p></dd><dt id="boot"><span class="term"><code class="uri">boot</code></span><a class="headerlink" title="Permalink to this term" href="#boot"></a></dt><dd><p>Limit events to the current boot of the system
        (like <span class="command"><strong>journalctl --this--boot</strong></span>).</p></dd><dt id="KEY=match"><span class="term"><code class="uri"><em class="replaceable"><code>KEY</code></em>=<em class="replaceable"><code>match</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#KEY=match"></a></dt><dd><p>Match journal fields. See
79
        <a href="systemd.journal-fields.html"><span class="citerefentry"><span class="refentrytitle">systemd.journal-fields</span>(7)</span></a>.</p></dd></dl></div></div><div class="refsect1"><a name="idm214188826192"></a><h2 id="Examples">Examples<a class="headerlink" title="Permalink to this headline" href="#Examples"></a></h2><p>Retrieve events from this boot from local journal
80 81
    in <a class="ulink" href="http://www.freedesktop.org/wiki/Software/systemd/export" target="_top">Journal
    Export Format</a>:
82 83
    </p><pre class="programlisting">curl --silent -H'Accept: application/vnd.fdo.journal' \
       'http://localhost:19531/entries?boot'</pre><p>
84
    </p><p>Listen for core dumps:
85
    </p><pre class="programlisting">curl 'http://localhost:19531/entries?follow&amp;MESSAGE_ID=fc2e22bc6ee647b6b90729ab34a250b1'</pre></div><div class="refsect1"><a name="idm214184189536"></a><h2 id="See Also">See Also<a class="headerlink" title="Permalink to this headline" href="#See%20Also"></a></h2><p>
86 87 88 89 90
      <a href="systemd.html"><span class="citerefentry"><span class="refentrytitle">systemd</span>(1)</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-fields.html"><span class="citerefentry"><span class="refentrytitle">systemd.journal-fields</span>(7)</span></a>,
    </p></div></div></body></html>