2018-07-03 00:15:39 +03:00
<?xml version='1.0'?>
2019-03-14 16:40:58 +03:00
< !DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
2023-12-25 17:48:33 +03:00
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
2020-11-09 07:23:58 +03:00
<!-- SPDX - License - Identifier: LGPL - 2.1 - or - later -->
2012-11-25 19:39:07 +04:00
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>
</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 >
2015-06-18 20:47:44 +03:00
<command > /usr/lib/systemd/systemd-journal-gatewayd</command>
2013-01-18 10:41:01 +04:00
<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>
2020-07-17 13:58:19 +03:00
<listitem > <para > Specify the path to a file or <constant > AF_UNIX</constant> stream socket to read the
server certificate from. The certificate must be in PEM format. This option switches
<command > systemd-journal-gatewayd</command> into HTTPS mode and must be used together with
2023-08-22 19:52:36 +03:00
<option > --key=</option> .</para>
<xi:include href= "version-info.xml" xpointer= "v198" /> </listitem>
2013-01-18 10:41:01 +04:00
</varlistentry>
<varlistentry >
<term > <option > --key=</option> </term>
2020-07-17 13:58:19 +03:00
<listitem > <para > Specify the path to a file or <constant > AF_UNIX</constant> stream socket to read the
2020-11-04 18:23:11 +03:00
secret server key corresponding to the certificate specified with <option > --cert=</option> from. The
2023-08-22 19:52:36 +03:00
key must be in PEM format.</para>
<xi:include href= "version-info.xml" xpointer= "v198" /> </listitem>
2013-01-18 10:41:01 +04:00
</varlistentry>
2017-12-04 09:42:48 +03:00
<varlistentry >
<term > <option > --trust=</option> </term>
2020-07-17 13:58:19 +03:00
<listitem > <para > Specify the path to a file or <constant > AF_UNIX</constant> stream socket to read a CA
2023-08-22 19:52:36 +03:00
certificate from. The certificate must be in PEM format.</para>
<xi:include href= "version-info.xml" xpointer= "v236" /> </listitem>
2017-12-04 09:42:48 +03:00
</varlistentry>
2021-04-29 22:45:53 +03:00
<varlistentry >
<term > <option > --system</option> </term>
<term > <option > --user</option> </term>
<listitem > <para > Limit served entries to entries from system
services and the kernel, or to entries from services of
current user. This has the same meaning as
<option > --system</option> and <option > --user</option> options
for
<citerefentry > <refentrytitle > journalctl</refentrytitle> <manvolnum > 1</manvolnum> </citerefentry> . If
neither is specified, all accessible entries are served.
2023-08-22 19:52:36 +03:00
</para>
<xi:include href= "version-info.xml" xpointer= "v249" /> </listitem>
2021-04-29 22:45:53 +03:00
</varlistentry>
<varlistentry >
<term > <option > -m</option> </term>
<term > <option > --merge</option> </term>
<listitem > <para > Serve entries interleaved from all available
journals, including other machines. This has the same meaning
as <option > --merge</option> option for
2023-08-22 19:52:36 +03:00
<citerefentry > <refentrytitle > journalctl</refentrytitle> <manvolnum > 1</manvolnum> </citerefentry> .</para>
<xi:include href= "version-info.xml" xpointer= "v249" /> </listitem>
2021-04-29 22:45:53 +03:00
</varlistentry>
2016-08-06 20:00:31 +03:00
<varlistentry >
<term > <option > -D <replaceable > DIR</replaceable> </option> </term>
<term > <option > --directory=<replaceable > DIR</replaceable> </option> </term>
<listitem > <para > Takes a directory path as argument. If
specified, <command > systemd-journal-gatewayd</command> will serve the
specified journal directory <replaceable > DIR</replaceable> instead of
2023-08-22 19:52:36 +03:00
the default runtime and system journal paths.</para>
<xi:include href= "version-info.xml" xpointer= "v232" /> </listitem>
2016-08-06 20:00:31 +03:00
</varlistentry>
2021-04-29 22:45:53 +03:00
<varlistentry >
<term > <option > --file=<replaceable > GLOB</replaceable> </option> </term>
<listitem > <para > Takes a file glob as an argument. Serve
entries from the specified journal files matching
<replaceable > GLOB</replaceable> instead of the default runtime
and system journal paths. May be specified multiple times, in
which case files will be suitably interleaved. This has the same meaning as
<option > --file=</option> option for
<citerefentry > <refentrytitle > journalctl</refentrytitle> <manvolnum > 1</manvolnum> </citerefentry> .
2023-08-22 19:52:36 +03:00
</para>
<xi:include href= "version-info.xml" xpointer= "v249" /> </listitem>
2021-04-29 22:45:53 +03:00
</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
2023-08-22 19:52:36 +03:00
<listitem > <para > Interactive browsing.</para>
<xi:include href= "version-info.xml" xpointer= "v197" /> </listitem>
2012-11-25 19:39:07 +04:00
</varlistentry>
<varlistentry >
2016-12-12 01:01:07 +03: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>
2023-08-22 19:52:36 +03:00
2023-09-18 18:03:38 +03:00
<xi:include href= "version-info.xml" xpointer= "v197" />
2012-11-25 19:39:07 +04:00
</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",
2016-12-12 01:01:07 +03:00
…}</programlisting>
2012-11-28 20:47:10 +04:00
</para>
2023-08-22 19:52:36 +03:00
<xi:include href= "version-info.xml" xpointer= "v197" />
2012-11-28 20:47:10 +04:00
</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>
2023-08-22 19:52:36 +03:00
<xi:include href= "version-info.xml" xpointer= "v197" />
2012-11-28 20:47:10 +04:00
</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>
2023-08-22 19:52:36 +03:00
<xi:include href= "version-info.xml" xpointer= "v197" />
2012-11-25 19:39:07 +04:00
</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> ).
2022-01-12 13:32:53 +03:00
See <ulink url= "https://systemd.io/JOURNAL_EXPORT_FORMATS#journal-json-format" > Journal JSON Format</ulink>
for more information.</para>
2023-08-22 19:52:36 +03:00
<xi:include href= "version-info.xml" xpointer= "v197" />
2012-11-25 19:39:07 +04:00
</listitem>
</varlistentry>
<varlistentry >
2016-01-11 18:38:35 +03:00
<term > <constant > text/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>
2023-08-22 19:52:36 +03:00
<xi:include href= "version-info.xml" xpointer= "v229" />
2012-11-25 19:39:07 +04:00
</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
2022-01-12 13:32:53 +03: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="https://systemd.io/JOURNAL_EXPORT_FORMATS#journal-export-format">Journal Export Format</ulink>
for more information.</para>
2023-08-22 19:52:36 +03:00
<xi:include href= "version-info.xml" xpointer= "v197" />
2012-11-25 19:39:07 +04:00
</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>
2023-10-05 22:39:45 +03:00
<para >
<option > Range: realtime=[<replaceable > since</replaceable> ]:[<replaceable > until</replaceable> ][[:<replaceable > num_skip</replaceable> ]:<replaceable > num_entries</replaceable> ]</option>
</para>
2012-11-25 19:39:07 +04:00
<para > where
2020-07-06 11:49:59 +03:00
<replaceable > cursor</replaceable> is a cursor string,
2023-10-05 22:39:45 +03:00
<replaceable > since</replaceable> and <replaceable > until</replaceable> are timestamps (seconds since 1970-01-01 00:00:00 UTC),
2020-07-06 11:49:59 +03:00
<replaceable > num_skip</replaceable> is an integer,
<replaceable > num_entries</replaceable> is an unsigned integer.
2012-11-25 19:39:07 +04:00
</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>
2023-08-22 19:52:36 +03:00
<xi:include href= "version-info.xml" xpointer= "v197" />
2012-11-25 19:39:07 +04:00
</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>
2023-08-22 19:52:36 +03:00
<xi:include href= "version-info.xml" xpointer= "v197" />
2012-11-25 19:39:07 +04:00
</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
2023-08-22 19:52:36 +03:00
(like <command > journalctl -b</command> ).</para>
<xi:include href= "version-info.xml" xpointer= "v197" /> </listitem>
2012-11-25 19:39:07 +04:00
</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>
2023-08-22 19:52:36 +03:00
2023-09-18 18:03:38 +03:00
<xi:include href= "version-info.xml" xpointer= "v197" />
2012-11-25 19:39:07 +04:00
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 >
<title > Examples</title>
2022-01-12 13:32:53 +03:00
<para > Retrieve events from this boot from local journal in
<ulink url= "https://systemd.io/JOURNAL_EXPORT_FORMATS#journal-export-format" > 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>
2023-12-22 21:09:32 +03:00
<para > <simplelist type= "inline" >
<member > <citerefentry > <refentrytitle > systemd</refentrytitle> <manvolnum > 1</manvolnum> </citerefentry> </member>
<member > <citerefentry > <refentrytitle > journalctl</refentrytitle> <manvolnum > 1</manvolnum> </citerefentry> </member>
<member > <citerefentry > <refentrytitle > systemd.journal-fields</refentrytitle> <manvolnum > 7</manvolnum> </citerefentry> </member>
<member > <citerefentry > <refentrytitle > systemd-journald.service</refentrytitle> <manvolnum > 8</manvolnum> </citerefentry> </member>
<member > <citerefentry > <refentrytitle > systemd-journal-remote.service</refentrytitle> <manvolnum > 8</manvolnum> </citerefentry> </member>
<member > <citerefentry > <refentrytitle > systemd-journal-upload.service</refentrytitle> <manvolnum > 8</manvolnum> </citerefentry> </member>
</simplelist> </para>
2012-11-25 19:39:07 +04:00
</refsect1>
</refentry>