2014-11-21 22:44:48 +03:00
<?xml version='1.0'?> <!-- * - Mode: nxml; nxml - child - indent: 2; indent - tabs - mode: nil - * -->
2012-11-25 19:39:07 +04:00
< !DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<!--
This file is part of systemd.
Copyright 2012 Zbigniew Jędrzejewski-Szmek
systemd is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http: / / w w w . g n u . o r g / l i c e n s e s /> .
-->
2014-02-13 23:33:51 +04:00
<refentry id= "systemd-journal-gatewayd.service" conditional= 'HAVE_MICROHTTPD'
xmlns:xi="http://www.w3.org/2001/XInclude">
2012-11-25 19:39:07 +04:00
<refentryinfo >
<title > systemd-journal-gatewayd.service</title>
<productname > systemd</productname>
<authorgroup >
<author >
<contrib > Developer</contrib>
<firstname > Zbigniew</firstname>
<surname > Jędrzejewski-Szmek</surname>
<email > zbyszek@in.waw.pl</email>
</author>
</authorgroup>
</refentryinfo>
<refmeta >
<refentrytitle > systemd-journal-gatewayd.service</refentrytitle>
<manvolnum > 8</manvolnum>
</refmeta>
<refnamediv >
<refname > systemd-journal-gatewayd.service</refname>
<refname > systemd-journal-gatewayd.socket</refname>
<refname > systemd-journal-gatewayd</refname>
<refpurpose > HTTP server for journal events</refpurpose>
</refnamediv>
<refsynopsisdiv >
<para > <filename > systemd-journal-gatewayd.service</filename> </para>
<para > <filename > systemd-journal-gatewayd.socket</filename> </para>
2013-01-18 10:41:01 +04:00
<cmdsynopsis >
<command > /usr/lib/systemd/systemd-journal-gatewayd</command>
<arg choice= "opt" rep= "repeat" > OPTIONS</arg>
2012-11-25 19:39:07 +04:00
</cmdsynopsis>
</refsynopsisdiv>
<refsect1 >
<title > Description</title>
<para > <command > systemd-journal-gatewayd</command> serves journal
events over the network. Clients must connect using
2013-01-18 10:41:01 +04:00
HTTP. The server listens on port 19531 by default.
If <option > --cert=</option> is specified, the server expects
HTTPS connections.</para>
2012-11-25 19:39:07 +04:00
<para > The program is started by
<citerefentry > <refentrytitle > systemd</refentrytitle> <manvolnum > 1</manvolnum> </citerefentry>
and expects to receive a single socket. Use
<command > systemctl start systemd-journal-gatewayd.socket</command> to start
the service, and <command > systemctl enable systemd-journal-gatewayd.socket</command>
to have it started on boot.</para>
</refsect1>
2013-01-18 10:41:01 +04:00
<refsect1 >
<title > Options</title>
<para > The following options are understood:</para>
<variablelist >
<varlistentry >
<term > <option > --cert=</option> </term>
<listitem > <para > Specify the path to a file containing a server
certificate in PEM format. This option switches
<command > systemd-journal-gatewayd</command> into HTTPS mode
and must be used together with
<option > --key=</option> .</para> </listitem>
</varlistentry>
<varlistentry >
<term > <option > --key=</option> </term>
<listitem > <para > Specify the path to a file containing a server
key in PEM format corresponding to the certificate specified
with <option > --cert=</option> .</para> </listitem>
</varlistentry>
2014-02-13 23:33:51 +04:00
<xi:include href= "standard-options.xml" xpointer= "help" />
<xi:include href= "standard-options.xml" xpointer= "version" />
2013-01-18 10:41:01 +04:00
</variablelist>
</refsect1>
2012-11-25 19:39:07 +04:00
<refsect1 >
<title > Supported URLs</title>
<para > The following URLs are recognized:</para>
<variablelist >
<varlistentry >
2013-01-26 19:45:37 +04:00
<term > <uri > /browse</uri> </term>
2012-11-25 19:39:07 +04:00
<listitem > <para > Interactive browsing.</para> </listitem>
</varlistentry>
<varlistentry >
2013-01-26 19:45:37 +04:00
<term > <uri > /entries[?option1& option2=value...]</uri> </term>
2012-11-25 19:39:07 +04:00
<listitem > <para > Retrieval of events in various formats.</para>
<para > The <option > Accept:</option> part of the HTTP header
determines the format. Supported values are described below.
</para>
<para > The <option > Range:</option> part of the HTTP header
determines the range of events returned. Supported values are
described below.
</para>
<para > GET parameters can be used to modify what events are
returned. Supported parameters are described below.</para>
</listitem>
</varlistentry>
2012-11-28 20:47:10 +04:00
<varlistentry >
2013-01-26 19:45:37 +04:00
<term > <uri > /machine</uri> </term>
2012-11-28 20:47:10 +04:00
2012-12-02 07:48:42 +04:00
<listitem > <para > Return a JSON structure describing the machine.</para>
2012-11-28 20:47:10 +04:00
<para > Example:
2014-02-14 18:56:19 +04:00
<programlisting > { "machine_id" : "8cf7ed9d451ea194b77a9f118f3dc446",
2012-11-28 20:47:10 +04:00
"boot_id" : "3d3c9efaf556496a9b04259ee35df7f7",
"hostname" : "fedora",
"os_pretty_name" : "Fedora 19 (Rawhide)",
"virtualization" : "kvm",
2014-02-14 18:56:19 +04:00
...}</programlisting>
2012-11-28 20:47:10 +04:00
</para>
</listitem>
</varlistentry>
<varlistentry >
2013-01-26 19:45:37 +04:00
<term > <uri > /fields/<replaceable > FIELD_NAME</replaceable> </uri> </term>
2012-11-28 20:47:10 +04:00
<listitem > <para > Return a list of values of this field present in the logs.</para>
</listitem>
</varlistentry>
2012-11-25 19:39:07 +04:00
</variablelist>
</refsect1>
<refsect1 >
<title > Accept header</title>
<para >
2013-01-26 19:45:37 +04:00
<option > Accept: <replaceable > format</replaceable> </option>
2012-11-25 19:39:07 +04:00
</para>
<para > Recognized formats:</para>
<variablelist >
<varlistentry >
2013-01-26 19:45:37 +04:00
<term > <constant > text/plain</constant> </term>
2012-11-25 19:39:07 +04:00
<listitem > <para > The default. Plaintext syslog-like output,
one line per journal entry
(like <command > journalctl --output short</command> ).</para>
</listitem>
</varlistentry>
<varlistentry >
2013-01-26 19:45:37 +04:00
<term > <constant > application/json</constant> </term>
2012-11-25 19:39:07 +04:00
<listitem > <para > Entries are formatted as JSON data structures,
one per line
(like <command > journalctl --output json</command> ).
See <ulink
url="http://www.freedesktop.org/wiki/Software/systemd/json">Journal
JSON Format</ulink> for more information.</para>
</listitem>
</varlistentry>
<varlistentry >
2013-01-26 19:45:37 +04:00
<term > <constant > application/event-stream</constant> </term>
2012-11-25 19:39:07 +04:00
<listitem > <para > Entries are formatted as JSON data structures,
wrapped in a format suitable for <ulink
url="https://developer.mozilla.org/en-US/docs/Server-sent_events/Using_server-sent_events">
Server-Sent Events</ulink>
(like <command > journalctl --output json-sse</command> ).
</para>
</listitem>
</varlistentry>
<varlistentry >
2013-01-26 19:45:37 +04:00
<term > <constant > application/vnd.fdo.journal</constant> </term>
2012-11-25 19:39:07 +04:00
<listitem > <para > Entries are serialized into a binary (but
mostly text-based) stream suitable for backups and network
transfer
(like <command > journalctl --output export</command> ).
See <ulink
url="http://www.freedesktop.org/wiki/Software/systemd/export">Journal
Export Format</ulink> for more information.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 >
<title > Range header</title>
<para >
2013-01-26 19:45:37 +04:00
<option > Range: entries=<replaceable > cursor</replaceable> [[:<replaceable > num_skip</replaceable> ]:<replaceable > num_entries</replaceable> ]</option>
2012-11-25 19:39:07 +04:00
</para>
<para > where
<option > cursor</option> is a cursor string,
<option > num_skip</option> is an integer,
<option > num_entries</option> is an unsigned integer.
</para>
<para > Range defaults to all available events.</para>
</refsect1>
<refsect1 >
<title > URL GET parameters</title>
<para > Following parameters can be used as part of the URL:</para>
<variablelist >
<varlistentry >
2013-01-26 19:45:37 +04:00
<term > <uri > follow</uri> </term>
2012-11-25 19:39:07 +04:00
<listitem > <para > wait for new events
(like <command > journalctl --follow</command> , except that
the number of events returned is not limited).</para>
</listitem>
</varlistentry>
<varlistentry >
2013-01-26 19:45:37 +04:00
<term > <uri > discrete</uri> </term>
2012-11-25 19:39:07 +04:00
<listitem > <para > Test that the specified cursor refers to an
entry in the journal. Returns just this entry.</para>
</listitem>
</varlistentry>
<varlistentry >
2013-01-26 19:45:37 +04:00
<term > <uri > boot</uri> </term>
2012-11-25 19:39:07 +04:00
<listitem > <para > Limit events to the current boot of the system
(like <command > journalctl --this--boot</command> ).</para> </listitem>
</varlistentry>
<varlistentry >
2013-01-26 19:45:37 +04:00
<term > <uri > <replaceable > KEY</replaceable> =<replaceable > match</replaceable> </uri> </term>
2012-11-25 19:39:07 +04:00
<listitem > <para > Match journal fields. See
<citerefentry > <refentrytitle > systemd.journal-fields</refentrytitle> <manvolnum > 7</manvolnum> </citerefentry> .</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 >
<title > Examples</title>
<para > Retrieve events from this boot from local journal
in <ulink
url="http://www.freedesktop.org/wiki/Software/systemd/export">Journal
Export Format</ulink> :
2014-02-14 18:56:19 +04:00
<programlisting > curl --silent -H'Accept: application/vnd.fdo.journal' \
'http://localhost:19531/entries?boot'</programlisting>
2012-11-25 19:39:07 +04:00
</para>
<para > Listen for core dumps:
2014-02-14 18:56:19 +04:00
<programlisting > curl 'http://localhost:19531/entries?follow& MESSAGE_ID=fc2e22bc6ee647b6b90729ab34a250b1'</programlisting> </para>
2012-11-25 19:39:07 +04:00
</refsect1>
<refsect1 >
<title > See Also</title>
<para >
<citerefentry > <refentrytitle > systemd</refentrytitle> <manvolnum > 1</manvolnum> </citerefentry> ,
<citerefentry > <refentrytitle > journalctl</refentrytitle> <manvolnum > 1</manvolnum> </citerefentry> ,
<citerefentry > <refentrytitle > systemd-journald.service</refentrytitle> <manvolnum > 8</manvolnum> </citerefentry> ,
<citerefentry > <refentrytitle > systemd.journal-fields</refentrytitle> <manvolnum > 7</manvolnum> </citerefentry> ,
</para>
</refsect1>
</refentry>