1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
|
'\" t
.TH "SYSTEMD\-JOURNAL\-GATEWAYD\&.SERVICE" "8" "" "systemd 255" "systemd-journal-gatewayd.service"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
systemd-journal-gatewayd.service, systemd-journal-gatewayd.socket, systemd-journal-gatewayd \- HTTP server for journal events
.SH "SYNOPSIS"
.PP
systemd\-journal\-gatewayd\&.service
.PP
systemd\-journal\-gatewayd\&.socket
.HP \w'\fB/usr/lib/systemd/systemd\-journal\-gatewayd\fR\ 'u
\fB/usr/lib/systemd/systemd\-journal\-gatewayd\fR [OPTIONS...]
.SH "DESCRIPTION"
.PP
\fBsystemd\-journal\-gatewayd\fR
serves journal events over the network\&. Clients must connect using HTTP\&. The server listens on port 19531 by default\&. If
\fB\-\-cert=\fR
is specified, the server expects HTTPS connections\&.
.PP
The program is started by
\fBsystemd\fR(1)
and expects to receive a single socket\&. Use
\fBsystemctl start systemd\-journal\-gatewayd\&.socket\fR
to start the service, and
\fBsystemctl enable systemd\-journal\-gatewayd\&.socket\fR
to have it started on boot\&.
.SH "OPTIONS"
.PP
The following options are understood:
.PP
\fB\-\-cert=\fR
.RS 4
Specify the path to a file or
\fBAF_UNIX\fR
stream socket to read the server certificate from\&. The certificate must be in PEM format\&. This option switches
\fBsystemd\-journal\-gatewayd\fR
into HTTPS mode and must be used together with
\fB\-\-key=\fR\&.
.sp
Added in version 198\&.
.RE
.PP
\fB\-\-key=\fR
.RS 4
Specify the path to a file or
\fBAF_UNIX\fR
stream socket to read the secret server key corresponding to the certificate specified with
\fB\-\-cert=\fR
from\&. The key must be in PEM format\&.
.sp
Added in version 198\&.
.RE
.PP
\fB\-\-trust=\fR
.RS 4
Specify the path to a file or
\fBAF_UNIX\fR
stream socket to read a CA certificate from\&. The certificate must be in PEM format\&.
.sp
Added in version 236\&.
.RE
.PP
\fB\-\-system\fR, \fB\-\-user\fR
.RS 4
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
\fB\-\-system\fR
and
\fB\-\-user\fR
options for
\fBjournalctl\fR(1)\&. If neither is specified, all accessible entries are served\&.
.sp
Added in version 249\&.
.RE
.PP
\fB\-m\fR, \fB\-\-merge\fR
.RS 4
Serve entries interleaved from all available journals, including other machines\&. This has the same meaning as
\fB\-\-merge\fR
option for
\fBjournalctl\fR(1)\&.
.sp
Added in version 249\&.
.RE
.PP
\fB\-D \fR\fB\fIDIR\fR\fR, \fB\-\-directory=\fR\fB\fIDIR\fR\fR
.RS 4
Takes a directory path as argument\&. If specified,
\fBsystemd\-journal\-gatewayd\fR
will serve the specified journal directory
\fIDIR\fR
instead of the default runtime and system journal paths\&.
.sp
Added in version 232\&.
.RE
.PP
\fB\-\-file=\fR\fB\fIGLOB\fR\fR
.RS 4
Takes a file glob as an argument\&. Serve entries from the specified journal files matching
\fIGLOB\fR
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
\fB\-\-file=\fR
option for
\fBjournalctl\fR(1)\&.
.sp
Added in version 249\&.
.RE
.PP
\fB\-h\fR, \fB\-\-help\fR
.RS 4
Print a short help text and exit\&.
.RE
.PP
\fB\-\-version\fR
.RS 4
Print a short version string and exit\&.
.RE
.SH "SUPPORTED URLS"
.PP
The following URLs are recognized:
.PP
/browse
.RS 4
Interactive browsing\&.
.sp
Added in version 197\&.
.RE
.PP
/entries[?option1&option2=value\&...]
.RS 4
Retrieval of events in various formats\&.
.sp
The
\fBAccept:\fR
part of the HTTP header determines the format\&. Supported values are described below\&.
.sp
The
\fBRange:\fR
part of the HTTP header determines the range of events returned\&. Supported values are described below\&.
.sp
GET parameters can be used to modify what events are returned\&. Supported parameters are described below\&.
.sp
Added in version 197\&.
.RE
.PP
/machine
.RS 4
Return a JSON structure describing the machine\&.
.sp
Example:
.sp
.if n \{\
.RS 4
.\}
.nf
{ "machine_id" : "8cf7ed9d451ea194b77a9f118f3dc446",
"boot_id" : "3d3c9efaf556496a9b04259ee35df7f7",
"hostname" : "fedora",
"os_pretty_name" : "Fedora 19 (Rawhide)",
"virtualization" : "kvm",
\&...}
.fi
.if n \{\
.RE
.\}
.sp
Added in version 197\&.
.RE
.PP
/fields/\fIFIELD_NAME\fR
.RS 4
Return a list of values of this field present in the logs\&.
.sp
Added in version 197\&.
.RE
.SH "ACCEPT HEADER"
.PP
\fBAccept: \fR\fB\fIformat\fR\fR
.PP
Recognized formats:
.PP
\fBtext/plain\fR
.RS 4
The default\&. Plaintext syslog\-like output, one line per journal entry (like
\fBjournalctl \-\-output short\fR)\&.
.sp
Added in version 197\&.
.RE
.PP
\fBapplication/json\fR
.RS 4
Entries are formatted as JSON data structures, one per line (like
\fBjournalctl \-\-output json\fR)\&. See
\m[blue]\fBJournal JSON Format\fR\m[]\&\s-2\u[1]\d\s+2
for more information\&.
.sp
Added in version 197\&.
.RE
.PP
\fBtext/event\-stream\fR
.RS 4
Entries are formatted as JSON data structures, wrapped in a format suitable for
\m[blue]\fBServer\-Sent Events\fR\m[]\&\s-2\u[2]\d\s+2
(like
\fBjournalctl \-\-output json\-sse\fR)\&.
.sp
Added in version 229\&.
.RE
.PP
\fBapplication/vnd\&.fdo\&.journal\fR
.RS 4
Entries are serialized into a binary (but mostly text\-based) stream suitable for backups and network transfer (like
\fBjournalctl \-\-output export\fR)\&. See
\m[blue]\fBJournal Export Format\fR\m[]\&\s-2\u[3]\d\s+2
for more information\&.
.sp
Added in version 197\&.
.RE
.SH "RANGE HEADER"
.PP
\fBRange: entries=\fR\fB\fIcursor\fR\fR\fB[[:\fR\fB\fInum_skip\fR\fR\fB]:\fR\fB\fInum_entries\fR\fR\fB]\fR
.PP
where
\fIcursor\fR
is a cursor string,
\fInum_skip\fR
is an integer,
\fInum_entries\fR
is an unsigned integer\&.
.PP
Range defaults to all available events\&.
.SH "URL GET PARAMETERS"
.PP
Following parameters can be used as part of the URL:
.PP
follow
.RS 4
wait for new events (like
\fBjournalctl \-\-follow\fR, except that the number of events returned is not limited)\&.
.sp
Added in version 197\&.
.RE
.PP
discrete
.RS 4
Test that the specified cursor refers to an entry in the journal\&. Returns just this entry\&.
.sp
Added in version 197\&.
.RE
.PP
boot
.RS 4
Limit events to the current boot of the system (like
\fBjournalctl \-b\fR)\&.
.sp
Added in version 197\&.
.RE
.PP
\fIKEY\fR=\fImatch\fR
.RS 4
Match journal fields\&. See
\fBsystemd.journal-fields\fR(7)\&.
.sp
Added in version 197\&.
.RE
.SH "EXAMPLES"
.PP
Retrieve events from this boot from local journal in
\m[blue]\fBJournal Export Format\fR\m[]\&\s-2\u[3]\d\s+2:
.sp
.if n \{\
.RS 4
.\}
.nf
curl \-\-silent \-H\*(AqAccept: application/vnd\&.fdo\&.journal\*(Aq \e
\*(Aqhttp://localhost:19531/entries?boot\*(Aq
.fi
.if n \{\
.RE
.\}
.PP
Listen for core dumps:
.sp
.if n \{\
.RS 4
.\}
.nf
curl \*(Aqhttp://localhost:19531/entries?follow&MESSAGE_ID=fc2e22bc6ee647b6b90729ab34a250b1\*(Aq
.fi
.if n \{\
.RE
.\}
.SH "SEE ALSO"
.PP
\fBsystemd\fR(1),
\fBjournalctl\fR(1),
\fBsystemd.journal-fields\fR(7),
\fBsystemd-journald.service\fR(8),
\fBsystemd-journal-remote.service\fR(8),
\fBsystemd-journal-upload.service\fR(8)
.SH "NOTES"
.IP " 1." 4
Journal JSON Format
.RS 4
\%https://systemd.io/JOURNAL_EXPORT_FORMATS#journal-json-format
.RE
.IP " 2." 4
Server-Sent Events
.RS 4
\%https://developer.mozilla.org/en-US/docs/Server-sent_events/Using_server-sent_events
.RE
.IP " 3." 4
Journal Export Format
.RS 4
\%https://systemd.io/JOURNAL_EXPORT_FORMATS#journal-export-format
.RE
|