1SYSTEMD.JOURNAL-FIELDS(7) systemd.journal-fields SYSTEMD.JOURNAL-FIELDS(7)
2
3
4
6 systemd.journal-fields - Special journal fields
7
9 Entries in the journal (as written by systemd-journald.service(8))
10 resemble a UNIX process environment block in syntax but with field
11 values that may include binary data, and with non-unique field names
12 permitted. Primarily, field values are formatted UTF-8 text strings —
13 binary encoding is used only where formatting as UTF-8 text strings
14 makes little sense. New fields may freely be defined by applications,
15 but a few fields have special meanings, which are listed below.
16 Typically, fields may only appear once per log entry, however there are
17 special exceptions: some fields may appear more than once per entry, in
18 which case this is explicitly mentioned below. Even though the logging
19 subsystem makes no restrictions on which fields to accept non-unique
20 values for, it is strongly recommended to avoid relying on this for the
21 fields listed below (except where listed otherwise, as mentioned) in
22 order to avoid unnecessary incompatibilities with other applications.
23
25 User fields are fields that are directly passed from clients and stored
26 in the journal.
27
28 MESSAGE=
29 The human-readable message string for this entry. This is supposed
30 to be the primary text shown to the user. It is usually not
31 translated (but might be in some cases), and is not supposed to be
32 parsed for metadata. In order to encode multiple lines in a single
33 log entry, separate them by newline characters (ASCII code 10), but
34 encode them as a single MESSAGE= field. Do not add multiple values
35 of this field type to the same entry (also see above), as consuming
36 applications generally do not expect this and are unlikely to show
37 all values in that case.
38
39 MESSAGE_ID=
40 A 128-bit message identifier ID for recognizing certain message
41 types, if this is desirable. This should contain a 128-bit ID
42 formatted as a lower-case hexadecimal string, without any
43 separating dashes or suchlike. This is recommended to be a
44 UUID-compatible ID, but this is not enforced, and formatted
45 differently. Developers can generate a new ID for this purpose with
46 systemd-id128 new.
47
48 PRIORITY=
49 A priority value between 0 ("emerg") and 7 ("debug") formatted as a
50 decimal string. This field is compatible with syslog's priority
51 concept.
52
53 CODE_FILE=, CODE_LINE=, CODE_FUNC=
54 The code location generating this message, if known. Contains the
55 source filename, the line number and the function name.
56
57 ERRNO=
58 The low-level Unix error number causing this entry, if any.
59 Contains the numeric value of errno(3) formatted as a decimal
60 string.
61
62 INVOCATION_ID=, USER_INVOCATION_ID=
63 A randomized, unique 128-bit ID identifying each runtime cycle of
64 the unit. This is different from _SYSTEMD_INVOCATION_ID in that it
65 is only used for messages coming from systemd code (e.g. logs from
66 the system/user manager or from forked processes performing
67 systemd-related setup).
68
69 SYSLOG_FACILITY=, SYSLOG_IDENTIFIER=, SYSLOG_PID=, SYSLOG_TIMESTAMP=
70 Syslog compatibility fields containing the facility (formatted as
71 decimal string), the identifier string (i.e. "tag"), the client
72 PID, and the timestamp as specified in the original datagram. (Note
73 that the tag is usually derived from glibc's
74 program_invocation_short_name variable, see
75 program_invocation_short_name(3).)
76
77 Note that the journal service does not validate the values of any
78 structured journal fields whose name is not prefixed with an
79 underscore, and this includes any syslog related fields such as
80 these. Hence, applications that supply a facility, PID, or log
81 level are expected to do so properly formatted, i.e. as numeric
82 integers formatted as decimal strings.
83
84 SYSLOG_RAW=
85 The original contents of the syslog line as received in the syslog
86 datagram. This field is only included if the MESSAGE= field was
87 modified compared to the original payload or the timestamp could
88 not be located properly and is not included in SYSLOG_TIMESTAMP=.
89 Message truncation occurs when the message contains leading or
90 trailing whitespace (trailing and leading whitespace is stripped),
91 or it contains an embedded NUL byte (the NUL byte and anything
92 after it is not included). Thus, the original syslog line is either
93 stored as SYSLOG_RAW= or it can be recreated based on the stored
94 priority and facility, timestamp, identifier, and the message
95 payload in MESSAGE=.
96
97 DOCUMENTATION=
98 A documentation URL with further information about the topic of the
99 log message. Tools such as journalctl will include a hyperlink to
100 an URL specified this way in their output. Should be an "http://",
101 "https://", "file:/", "man:" or "info:" URL.
102
103 TID=
104 The numeric thread ID (TID) the log message originates from.
105
106 UNIT=, USER_UNIT=
107 The name of a unit. Used by the system and user managers when
108 logging about specific units.
109
110 When --unit=name or --user-unit=name are used with journalctl(1), a
111 match pattern that includes "UNIT=name.service" or
112 "USER_UNIT=name.service" will be generated.
113
115 Fields prefixed with an underscore are trusted fields, i.e. fields that
116 are implicitly added by the journal and cannot be altered by client
117 code.
118
119 _PID=, _UID=, _GID=
120 The process, user, and group ID of the process the journal entry
121 originates from formatted as a decimal string. Note that entries
122 obtained via "stdout" or "stderr" of forked processes will contain
123 credentials valid for a parent process (that initiated the
124 connection to systemd-journald).
125
126 _COMM=, _EXE=, _CMDLINE=
127 The name, the executable path, and the command line of the process
128 the journal entry originates from.
129
130 _CAP_EFFECTIVE=
131 The effective capabilities(7) of the process the journal entry
132 originates from.
133
134 _AUDIT_SESSION=, _AUDIT_LOGINUID=
135 The session and login UID of the process the journal entry
136 originates from, as maintained by the kernel audit subsystem.
137
138 _SYSTEMD_CGROUP=, _SYSTEMD_SLICE=, _SYSTEMD_UNIT=, _SYSTEMD_USER_UNIT=,
139 _SYSTEMD_USER_SLICE=, _SYSTEMD_SESSION=, _SYSTEMD_OWNER_UID=
140 The control group path in the systemd hierarchy, the systemd slice
141 unit name, the systemd unit name, the unit name in the systemd user
142 manager (if any), the systemd session ID (if any), and the owner
143 UID of the systemd user unit or systemd session (if any) of the
144 process the journal entry originates from.
145
146 _SELINUX_CONTEXT=
147 The SELinux security context (label) of the process the journal
148 entry originates from.
149
150 _SOURCE_REALTIME_TIMESTAMP=
151 The earliest trusted timestamp of the message, if any is known that
152 is different from the reception time of the journal. This is the
153 time in microseconds since the epoch UTC, formatted as a decimal
154 string.
155
156 _BOOT_ID=
157 The kernel boot ID for the boot the message was generated in,
158 formatted as a 128-bit hexadecimal string.
159
160 _MACHINE_ID=
161 The machine ID of the originating host, as available in machine-
162 id(5).
163
164 _SYSTEMD_INVOCATION_ID=
165 The invocation ID for the runtime cycle of the unit the message was
166 generated in, as available to processes of the unit in
167 $INVOCATION_ID (see systemd.exec(5)).
168
169 _HOSTNAME=
170 The name of the originating host.
171
172 _TRANSPORT=
173 How the entry was received by the journal service. Valid transports
174 are:
175
176 audit
177 for those read from the kernel audit subsystem
178
179 driver
180 for internally generated messages
181
182 syslog
183 for those received via the local syslog socket with the syslog
184 protocol
185
186 journal
187 for those received via the native journal protocol
188
189 stdout
190 for those read from a service's standard output or error output
191
192 kernel
193 for those read from the kernel
194
195 _STREAM_ID=
196 Only applies to "_TRANSPORT=stdout" records: specifies a randomized
197 128bit ID assigned to the stream connection when it was first
198 created. This ID is useful to reconstruct individual log streams
199 from the log records: all log records carrying the same stream ID
200 originate from the same stream.
201
202 _LINE_BREAK=
203 Only applies to "_TRANSPORT=stdout" records: indicates that the log
204 message in the standard output/error stream was not terminated with
205 a normal newline character ("\n", i.e. ASCII 10). Specifically,
206 when set this field is one of nul (in case the line was terminated
207 by a NUL byte), line-max (in case the maximum log line length was
208 reached, as configured with LineMax= in journald.conf(5)), eof (if
209 this was the last log record of a stream and the stream ended
210 without a final newline character), or pid-change (if the process
211 which generated the log output changed in the middle of a line).
212 Note that this record is not generated when a normal newline
213 character was used for marking the log line end.
214
215 _NAMESPACE=
216 If this file was written by a systemd-journald instance managing a
217 journal namespace that is not the default, this field contains the
218 namespace identifier. See systemd-journald.service(8) for details
219 about journal namespaces.
220
221 _RUNTIME_SCOPE=
222 A string field that specifies the runtime scope in which the
223 message was logged. If "initrd", the log message was processed
224 while the system was running inside the initrd. If "system", the
225 log message was generated after the system switched execution to
226 the host root filesystem.
227
229 Kernel fields are fields that are used by messages originating in the
230 kernel and stored in the journal.
231
232 _KERNEL_DEVICE=
233 The kernel device name. If the entry is associated to a block
234 device, contains the major and minor numbers of the device node,
235 separated by ":" and prefixed by "b". Similarly for character
236 devices, but prefixed by "c". For network devices, this is the
237 interface index prefixed by "n". For all other devices, this is the
238 subsystem name prefixed by "+", followed by ":", followed by the
239 kernel device name.
240
241 _KERNEL_SUBSYSTEM=
242 The kernel subsystem name.
243
244 _UDEV_SYSNAME=
245 The kernel device name as it shows up in the device tree below
246 /sys/.
247
248 _UDEV_DEVNODE=
249 The device node path of this device in /dev/.
250
251 _UDEV_DEVLINK=
252 Additional symlink names pointing to the device node in /dev/. This
253 field is frequently set more than once per entry.
254
256 Fields in this section are used by programs to specify that they are
257 logging on behalf of another program or unit.
258
259 Fields used by the systemd-coredump coredump kernel helper:
260
261 COREDUMP_UNIT=, COREDUMP_USER_UNIT=
262 Used to annotate messages containing coredumps from system and
263 session units. See coredumpctl(1).
264
265 Privileged programs (currently UID 0) may attach OBJECT_PID= to a
266 message. This will instruct systemd-journald to attach additional
267 fields on behalf of the caller:
268
269 OBJECT_PID=PID
270 PID of the program that this message pertains to.
271
272 OBJECT_UID=, OBJECT_GID=, OBJECT_COMM=, OBJECT_EXE=, OBJECT_CMDLINE=,
273 OBJECT_AUDIT_SESSION=, OBJECT_AUDIT_LOGINUID=, OBJECT_SYSTEMD_CGROUP=,
274 OBJECT_SYSTEMD_SESSION=, OBJECT_SYSTEMD_OWNER_UID=,
275 OBJECT_SYSTEMD_UNIT=, OBJECT_SYSTEMD_USER_UNIT=
276 These are additional fields added automatically by
277 systemd-journald. Their meaning is the same as _UID=, _GID=,
278 _COMM=, _EXE=, _CMDLINE=, _AUDIT_SESSION=, _AUDIT_LOGINUID=,
279 _SYSTEMD_CGROUP=, _SYSTEMD_SESSION=, _SYSTEMD_UNIT=,
280 _SYSTEMD_USER_UNIT=, and _SYSTEMD_OWNER_UID= as described above,
281 except that the process identified by PID is described, instead of
282 the process which logged the message.
283
285 During serialization into external formats, such as the Journal Export
286 Format[1] or the Journal JSON Format[2], the addresses of journal
287 entries are serialized into fields prefixed with double underscores.
288 Note that these are not proper fields when stored in the journal but
289 for addressing metadata of entries. They cannot be written as part of
290 structured log entries via calls such as sd_journal_send(3). They may
291 also not be used as matches for sd_journal_add_match(3).
292
293 __CURSOR=
294 The cursor for the entry. A cursor is an opaque text string that
295 uniquely describes the position of an entry in the journal and is
296 portable across machines, platforms and journal files.
297
298 __REALTIME_TIMESTAMP=
299 The wallclock time (CLOCK_REALTIME) at the point in time the entry
300 was received by the journal, in microseconds since the epoch UTC,
301 formatted as a decimal string. This has different properties from
302 "_SOURCE_REALTIME_TIMESTAMP=", as it is usually a bit later but
303 more likely to be monotonic.
304
305 __MONOTONIC_TIMESTAMP=
306 The monotonic time (CLOCK_MONOTONIC) at the point in time the entry
307 was received by the journal in microseconds, formatted as a decimal
308 string. To be useful as an address for the entry, this should be
309 combined with the boot ID in "_BOOT_ID=".
310
312 systemd(1), systemd-journald.service(8), journalctl(1),
313 journald.conf(5), sd-journal(3), coredumpctl(1), systemd.directives(7)
314
316 1. Journal Export Format
317 https://systemd.io/JOURNAL_EXPORT_FORMATS#journal-export-format
318
319 2. Journal JSON Format
320 https://systemd.io/JOURNAL_EXPORT_FORMATS#journal-json-format
321
322
323
324systemd 253 SYSTEMD.JOURNAL-FIELDS(7)