1SYSTEMD.JOURNAL-FIELDS(7)   systemd.journal-fields   SYSTEMD.JOURNAL-FIELDS(7)
2
3
4

NAME

6       systemd.journal-fields - Special journal fields
7

DESCRIPTION

9       Entries in the journal (as written by systemd-journald.service(8))
10       resemble a UNIX process environment block in syntax but with fields
11       that may include binary data. Primarily, fields are formatted UTF-8
12       text strings, and binary encoding is used only where formatting as
13       UTF-8 text strings makes little sense. New fields may freely be defined
14       by applications, but a few fields have special meanings. All fields
15       with special meanings are optional. In some cases, fields may appear
16       more than once per entry.
17

USER JOURNAL FIELDS

19       User fields are fields that are directly passed from clients and stored
20       in the journal.
21
22       MESSAGE=
23           The human-readable message string for this entry. This is supposed
24           to be the primary text shown to the user. It is usually not
25           translated (but might be in some cases), and is not supposed to be
26           parsed for metadata.
27
28       MESSAGE_ID=
29           A 128-bit message identifier ID for recognizing certain message
30           types, if this is desirable. This should contain a 128-bit ID
31           formatted as a lower-case hexadecimal string, without any
32           separating dashes or suchlike. This is recommended to be a
33           UUID-compatible ID, but this is not enforced, and formatted
34           differently. Developers can generate a new ID for this purpose with
35           systemd-id128 new.
36
37       PRIORITY=
38           A priority value between 0 ("emerg") and 7 ("debug") formatted as a
39           decimal string. This field is compatible with syslog's priority
40           concept.
41
42       CODE_FILE=, CODE_LINE=, CODE_FUNC=
43           The code location generating this message, if known. Contains the
44           source filename, the line number and the function name.
45
46       ERRNO=
47           The low-level Unix error number causing this entry, if any.
48           Contains the numeric value of errno(3) formatted as a decimal
49           string.
50
51       INVOCATION_ID=, USER_INVOCATION_ID=
52           A randomized, unique 128-bit ID identifying each runtime cycle of
53           the unit. This is different from _SYSTEMD_INVOCATION_ID in that it
54           is only used for messages coming from systemd code (e.g. logs from
55           the system/user manager or from forked processes performing
56           systemd-related setup).
57
58       SYSLOG_FACILITY=, SYSLOG_IDENTIFIER=, SYSLOG_PID=, SYSLOG_TIMESTAMP=
59           Syslog compatibility fields containing the facility (formatted as
60           decimal string), the identifier string (i.e. "tag"), the client
61           PID, and the timestamp as specified in the original datagram. (Note
62           that the tag is usually derived from glibc's
63           program_invocation_short_name variable, see
64           program_invocation_short_name(3).)
65
66           Note that the journal service does not validate the values of any
67           structured journal fields whose name is not prefixed with an
68           underscore, and this includes any syslog related fields such as
69           these. Hence, applications that supply a facility, PID, or log
70           level are expected to do so properly formatted, i.e. as numeric
71           integers formatted as decimal strings.
72
73       SYSLOG_RAW=
74           The original contents of the syslog line as received in the syslog
75           datagram. This field is only included if the MESSAGE= field was
76           modified compared to the original payload or the timestamp could
77           not be located properly and is not included in SYSLOG_TIMESTAMP=.
78           Message truncation occurs when when the message contains leading or
79           trailing whitespace (trailing and leading whitespace is stripped),
80           or it contains an embedded NUL byte (the NUL byte and anything
81           after it is not included). Thus, the original syslog line is either
82           stored as SYSLOG_RAW= or it can be recreated based on the stored
83           priority and facility, timestamp, identifier, and the message
84           payload in MESSAGE=.
85
86       DOCUMENTATION=
87           A documentation URL with further information about the topic of the
88           log message. Tools such as journalctl will include a hyperlink to
89           an URL specified this way in their output. Should be a "http://",
90           "https://", "file:/", "man:" or "info:" URL.
91

TRUSTED JOURNAL FIELDS

93       Fields prefixed with an underscore are trusted fields, i.e. fields that
94       are implicitly added by the journal and cannot be altered by client
95       code.
96
97       _PID=, _UID=, _GID=
98           The process, user, and group ID of the process the journal entry
99           originates from formatted as a decimal string. Note that entries
100           obtained via "stdout" or "stderr" of forked processes will contain
101           credentials valid for a parent process (that initiated the
102           connection to systemd-journald).
103
104       _COMM=, _EXE=, _CMDLINE=
105           The name, the executable path, and the command line of the process
106           the journal entry originates from.
107
108       _CAP_EFFECTIVE=
109           The effective capabilities(7) of the process the journal entry
110           originates from.
111
112       _AUDIT_SESSION=, _AUDIT_LOGINUID=
113           The session and login UID of the process the journal entry
114           originates from, as maintained by the kernel audit subsystem.
115
116       _SYSTEMD_CGROUP=, _SYSTEMD_SLICE=, _SYSTEMD_UNIT=, _SYSTEMD_USER_UNIT=,
117       _SYSTEMD_USER_SLICE=, _SYSTEMD_SESSION=, _SYSTEMD_OWNER_UID=
118           The control group path in the systemd hierarchy, the the systemd
119           slice unit name, the systemd unit name, the unit name in the
120           systemd user manager (if any), the systemd session ID (if any), and
121           the owner UID of the systemd user unit or systemd session (if any)
122           of the process the journal entry originates from.
123
124       _SELINUX_CONTEXT=
125           The SELinux security context (label) of the process the journal
126           entry originates from.
127
128       _SOURCE_REALTIME_TIMESTAMP=
129           The earliest trusted timestamp of the message, if any is known that
130           is different from the reception time of the journal. This is the
131           time in microseconds since the epoch UTC, formatted as a decimal
132           string.
133
134       _BOOT_ID=
135           The kernel boot ID for the boot the message was generated in,
136           formatted as a 128-bit hexadecimal string.
137
138       _MACHINE_ID=
139           The machine ID of the originating host, as available in machine-
140           id(5).
141
142       _SYSTEMD_INVOCATION_ID=
143           The invocation ID for the runtime cycle of the unit the message was
144           generated in, as available to processes of the unit in
145           $INVOCATION_ID (see systemd.exec(5)).
146
147       _HOSTNAME=
148           The name of the originating host.
149
150       _TRANSPORT=
151           How the entry was received by the journal service. Valid transports
152           are:
153
154           audit
155               for those read from the kernel audit subsystem
156
157           driver
158               for internally generated messages
159
160           syslog
161               for those received via the local syslog socket with the syslog
162               protocol
163
164           journal
165               for those received via the native journal protocol
166
167           stdout
168               for those read from a service's standard output or error output
169
170           kernel
171               for those read from the kernel
172
173       _STREAM_ID=
174           Only applies to "_TRANSPORT=stdout" records: specifies a randomized
175           128bit ID assigned to the stream connection when it was first
176           created. This ID is useful to reconstruct individual log streams
177           from the log records: all log records carrying the same stream ID
178           originate from the same stream.
179
180       _LINE_BREAK=
181           Only applies to "_TRANSPORT=stdout" records: indicates that the log
182           message in the standard output/error stream was not terminated with
183           a normal newline character ("\n", i.e. ASCII 10). Specifically,
184           when set this field is one of nul (in case the line was terminated
185           by a NUL byte), line-max (in case the maximum log line length was
186           reached, as configured with LineMax= in journald.conf(5)), eof (if
187           this was the last log record of a stream and the stream ended
188           without a final newline character), or pid-change (if the process
189           which generated the log output changed in the middle of a line).
190           Note that this record is not generated when a normal newline
191           character was used for marking the log line end.
192
193       _NAMESPACE=
194           If this file was written by a systemd-journald instance managing a
195           journal namespace that is not the default, this field contains the
196           namespace identifier. See systemd-journald.service(8) for details
197           about journal namespaces.
198

KERNEL JOURNAL FIELDS

200       Kernel fields are fields that are used by messages originating in the
201       kernel and stored in the journal.
202
203       _KERNEL_DEVICE=
204           The kernel device name. If the entry is associated to a block
205           device, the major and minor of the device node, separated by ":"
206           and prefixed by "b". Similar for character devices but prefixed by
207           "c". For network devices, this is the interface index prefixed by
208           "n". For all other devices, this is the subsystem name prefixed by
209           "+", followed by ":", followed by the kernel device name.
210
211       _KERNEL_SUBSYSTEM=
212           The kernel subsystem name.
213
214       _UDEV_SYSNAME=
215           The kernel device name as it shows up in the device tree below
216           /sys.
217
218       _UDEV_DEVNODE=
219           The device node path of this device in /dev.
220
221       _UDEV_DEVLINK=
222           Additional symlink names pointing to the device node in /dev. This
223           field is frequently set more than once per entry.
224

FIELDS TO LOG ON BEHALF OF A DIFFERENT PROGRAM

226       Fields in this section are used by programs to specify that they are
227       logging on behalf of another program or unit.
228
229       Fields used by the systemd-coredump coredump kernel helper:
230
231       COREDUMP_UNIT=, COREDUMP_USER_UNIT=
232           Used to annotate messages containing coredumps from system and
233           session units. See coredumpctl(1).
234
235       Privileged programs (currently UID 0) may attach OBJECT_PID= to a
236       message. This will instruct systemd-journald to attach additional
237       fields on behalf of the caller:
238
239       OBJECT_PID=PID
240           PID of the program that this message pertains to.
241
242       OBJECT_UID=, OBJECT_GID=, OBJECT_COMM=, OBJECT_EXE=, OBJECT_CMDLINE=,
243       OBJECT_AUDIT_SESSION=, OBJECT_AUDIT_LOGINUID=, OBJECT_SYSTEMD_CGROUP=,
244       OBJECT_SYSTEMD_SESSION=, OBJECT_SYSTEMD_OWNER_UID=,
245       OBJECT_SYSTEMD_UNIT=, OBJECT_SYSTEMD_USER_UNIT=
246           These are additional fields added automatically by
247           systemd-journald. Their meaning is the same as _UID=, _GID=,
248           _COMM=, _EXE=, _CMDLINE=, _AUDIT_SESSION=, _AUDIT_LOGINUID=,
249           _SYSTEMD_CGROUP=, _SYSTEMD_SESSION=, _SYSTEMD_UNIT=,
250           _SYSTEMD_USER_UNIT=, and _SYSTEMD_OWNER_UID= as described above,
251           except that the process identified by PID is described, instead of
252           the process which logged the message.
253

ADDRESS FIELDS

255       During serialization into external formats, such as the Journal Export
256       Format[1] or the Journal JSON Format[2], the addresses of journal
257       entries are serialized into fields prefixed with double underscores.
258       Note that these are not proper fields when stored in the journal but
259       for addressing metadata of entries. They cannot be written as part of
260       structured log entries via calls such as sd_journal_send(3). They may
261       also not be used as matches for sd_journal_add_match(3).
262
263       __CURSOR=
264           The cursor for the entry. A cursor is an opaque text string that
265           uniquely describes the position of an entry in the journal and is
266           portable across machines, platforms and journal files.
267
268       __REALTIME_TIMESTAMP=
269           The wallclock time (CLOCK_REALTIME) at the point in time the entry
270           was received by the journal, in microseconds since the epoch UTC,
271           formatted as a decimal string. This has different properties from
272           "_SOURCE_REALTIME_TIMESTAMP=", as it is usually a bit later but
273           more likely to be monotonic.
274
275       __MONOTONIC_TIMESTAMP=
276           The monotonic time (CLOCK_MONOTONIC) at the point in time the entry
277           was received by the journal in microseconds, formatted as a decimal
278           string. To be useful as an address for the entry, this should be
279           combined with the boot ID in "_BOOT_ID=".
280

SEE ALSO

282       systemd(1), systemd-journald.service(8), journalctl(1),
283       journald.conf(5), sd-journal(3), coredumpctl(1), systemd.directives(7)
284

NOTES

286        1. Journal Export Format
287           https://www.freedesktop.org/wiki/Software/systemd/export
288
289        2. Journal JSON Format
290           https://www.freedesktop.org/wiki/Software/systemd/json
291
292
293
294systemd 246                                          SYSTEMD.JOURNAL-FIELDS(7)
Impressum