SYSTEMD-....SERVICE(8)

๐Ÿ’… NAME ๐Ÿ’…

okay bestie, welcome to the systemd-journal-gatewayd.service page โ€” that's the manual name, and it lives in the SYSTEMD-....SERVICE(8) set, section 8, iykyk โœจ

  • systemd-journal-gatewayd.service
  • systemd-journal-gatewayd.socket
  • systemd-journal-gatewayd

โ€ฆand all three of those are literally an HTTP server for journal events. no cap ๐Ÿซถ

๐ŸŒธ SYNOPSIS ๐ŸŒธ

systemd-journal-gatewayd.service
systemd-journal-gatewayd.socket
/usr/lib/systemd/systemd-journal-gatewayd [OPTIONS...]

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

okay so systemd-journal-gatewayd serves journal events over the network. Clients must connect using HTTP. The server listens on port 19531 by default, periodt. ๐ŸŽ€

If --cert= is specified, the server expects HTTPS connections.

The program is started by systemd(1) and expects to receive a single socket. Use systemctl start systemd-journal-gatewayd.socket to start the service, and systemctl enable systemd-journal-gatewayd.socket to have it started on boot. slay ๐Ÿ’…

โœจ OPTIONS โœจ

The following options are understood:

  • --cert= โ€” Specify the path to a file or AF_UNIX stream socket to read the server certificate from. The certificate must be in PEM format. This option switches systemd-journal-gatewayd into HTTPS mode and must be used together with --key=. Added in version 198. ๐Ÿ”ฅ
  • --key= โ€” Specify the path to a file or AF_UNIX stream socket to read the secret server key corresponding to the certificate specified with --cert= from. The key must be in PEM format. Added in version 198. ๐Ÿ”‘
  • --trust= โ€” Specify the path to a file or AF_UNIX stream socket to read a CA certificate from. The certificate must be in PEM format. Added in version 236. ๐Ÿซถ
  • --system, --user โ€” 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 --system and --user options for journalctl(1). If neither is specified, all accessible entries are served. Added in version 249. ๐Ÿ‘‘
  • -m, --merge โ€” Serve entries interleaved from all available journals, including other machines. This has the same meaning as --merge option for journalctl(1). Added in version 249. ๐ŸŒˆ
  • -D DIR, --directory=DIR โ€” Takes a directory path as argument. If specified, systemd-journal-gatewayd will serve the specified journal directory DIR instead of the default runtime and system journal paths. Added in version 232. ๐Ÿ“
  • --file=GLOB โ€” Takes a file glob as an argument. Serve entries from the specified journal files matching GLOB 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 --file= option for journalctl(1). Added in version 249. ๐Ÿ—‚๏ธ
  • -h, --help โ€” Print a short help text and exit. ๐Ÿ™ˆ
  • --version โ€” Print a short version string and exit. โญ

๐ŸŽ€ SUPPORTED URLS ๐ŸŽ€

The following URLs are recognized:

/boots

Returns json-seq (RFC 7464) response containing JSON objects, each one containing boot number, its ID and the timestamps of the first and last message. Boots are returned starting with the latest boot first and use the same schema as journalctl --list-boots --output json.

Added in version 258. ๐Ÿ”ฅ

/browse

Interactive browsing.

Added in version 197. ๐Ÿฆ‹

/entries[?option1&option2=value...]

Retrieval of events in various formats.

The Accept: part of the HTTP header determines the format. Supported values are described below.

The Range: part of the HTTP header determines the range of events returned. Supported values are described below.

GET parameters can be used to modify what events are returned. Supported parameters are described below.

Added in version 197. โœจ

/machine

Return a JSON structure describing the machine.

Example:

{ "machine_id" : "8cf7ed9d451ea194b77a9f118f3dc446",
  "boot_id" : "3d3c9efaf556496a9b04259ee35df7f7",
  "hostname" : "fedora",
  "os_pretty_name" : "Fedora 19 (Rawhide)",
  "virtualization" : "kvm",
  ...}

Added in version 197. ๐Ÿ–ฅ๏ธ

/fields/FIELD_NAME

Return a list of values of this field present in the logs.

Added in version 197. ๐ŸŒธ


๐ŸŒˆ ACCEPT HEADER ๐ŸŒˆ

Accept: format

Recognized formats:

text/plain

The default. Plaintext syslog-like output, one line per journal entry (like journalctl --output short).

Added in version 197. ๐Ÿ“

application/json

Entries are formatted as JSON data structures, one per line (like journalctl --output json). See Journal JSON Format[1] for more information.

Added in version 197. ๐Ÿ’œ

text/event-stream

Entries are formatted as JSON data structures, wrapped in a format suitable for Server-Sent Events[2] (like journalctl --output json-sse).

Added in version 229. ๐Ÿ“ก

application/vnd.fdo.journal

Entries are serialized into a binary (but mostly text-based) stream suitable for backups and network transfer (like journalctl --output export). See Journal Export Format[3] for more information.

Added in version 197. ๐Ÿ’พ


๐Ÿ“ RANGE HEADER ๐Ÿ“

Range: entries=[cursor][[:num_skip]:[num_entries]]
Range: realtime=[since]:[until][[:num_skip]:num_entries]

where cursor is a cursor string, defaults to the first entry, since and until are timestamps (seconds since 1970-01-01 00:00:00 UTC), num_skip is an integer, num_entries is an unsigned integer. ๐Ÿงฎ

Range defaults to all available events.

If num_skip is negative and no cursor is given, the last entry will be the reference point.


๐Ÿงš URL GET PARAMETERS ๐Ÿงš

Following parameters can be used as part of the URL:

follow

wait for new events (like journalctl --follow, the number of events returned is not limited, unless num_entries is specified in the Range header).

Added in version 197. ๐Ÿ‘€

discrete

Test that the specified cursor refers to an entry in the journal. Returns just this entry.

Added in version 197. ๐ŸŽฏ

boot

Limit events to the current boot of the system (like journalctl -b).

Added in version 197. ๐Ÿฅพ

KEY=match

Match journal fields. See systemd.journal-fields(7).

Added in version 197. ๐Ÿ”


๐Ÿ’– EXAMPLES ๐Ÿ’–

Retrieve events from this boot from local journal in Journal Export Format[3]:

curl --silent -H'Accept: application/vnd.fdo.journal' \
       'http://localhost:19531/entries?boot'

Listen for core dumps:

curl 'http://localhost:19531/entries?follow&MESSAGE_ID=fc2e22bc6ee647b6b90729ab34a250b1'

๐Ÿ‘‘ SEE ALSO ๐Ÿ‘‘

systemd(1), journalctl(1), systemd.journal-fields(7), systemd-journald.service(8), systemd-journal-remote.service(8), systemd-journal-upload.service(8)

๐ŸŒŸ NOTES ๐ŸŒŸ

  1. Journal JSON Format โ€” https://systemd.io/JOURNAL_EXPORT_FORMATS#journal-json-format
  2. Server-Sent Events โ€” https://developer.mozilla.org/en-US/docs/Server-sent_events/Using_server-sent_events
  3. Journal Export Format โ€” https://systemd.io/JOURNAL_EXPORT_FORMATS#journal-export-format

okay that's the whole page bestie, every flag and every URL accounted for, no cap ๐Ÿ’€โœจ this was systemd 261.3 dropping the SYSTEMD-....SERVICE(8) manual page โ€” go serve some journals, you absolute main character ๐Ÿซถ๐ŸŽ€๐Ÿ’…

๐Ÿ“ฆ where this page comes from