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

TRUSTED JOURNAL FIELDS

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

KERNEL JOURNAL FIELDS

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

FIELDS TO LOG ON BEHALF OF A DIFFERENT PROGRAM

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

ADDRESS FIELDS

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

SEE ALSO

275       systemd(1), systemd-journald.service(8), journalctl(1),
276       journald.conf(5), sd-journal(3), coredumpctl(1), systemd.directives(7)
277

NOTES

279        1. Journal Export Format
280           https://www.freedesktop.org/wiki/Software/systemd/export
281
282        2. Journal JSON Format
283           https://www.freedesktop.org/wiki/Software/systemd/json
284
285
286
287systemd 245                                          SYSTEMD.JOURNAL-FIELDS(7)
Impressum