'\" t .TH "SYSTEMD\&.JOURNAL\-FIELDS" "7" "" "systemd 256.7" "systemd.journal-fields" .\" ----------------------------------------------------------------- .\" * 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-fields \- Special journal fields .SH "DESCRIPTION" .PP Entries in the journal (as written by \fBsystemd-journald.service\fR(8)) resemble a UNIX process environment block in syntax but with field values that may include binary data, and with non\-unique field names permitted\&. Primarily, field values are formatted UTF\-8 text strings \(em binary encoding is used only where formatting as UTF\-8 text strings makes little sense\&. New fields may freely be defined by applications, but a few fields have special meanings, which are listed below\&. Typically, fields may only appear once per log entry, however there are special exceptions: some fields may appear more than once per entry, in which case this is explicitly mentioned below\&. Even though the logging subsystem makes no restrictions on which fields to accept non\-unique values for, it is strongly recommended to avoid relying on this for the fields listed below (except where listed otherwise, as mentioned) in order to avoid unnecessary incompatibilities with other applications\&. .SH "USER JOURNAL FIELDS" .PP User fields are fields that are directly passed from clients and stored in the journal\&. .PP \fIMESSAGE=\fR .RS 4 The human\-readable message string for this entry\&. This is supposed to be the primary text shown to the user\&. It is usually not translated (but might be in some cases), and is not supposed to be parsed for metadata\&. In order to encode multiple lines in a single log entry, separate them by newline characters (ASCII code 10), but encode them as a single \fIMESSAGE=\fR field\&. Do not add multiple values of this field type to the same entry (also see above), as consuming applications generally do not expect this and are unlikely to show all values in that case\&. .RE .PP \fIMESSAGE_ID=\fR .RS 4 A 128\-bit message identifier ID for recognizing certain message types, if this is desirable\&. This should contain a 128\-bit ID formatted as a lower\-case hexadecimal string, without any separating dashes or suchlike\&. This is recommended to be a UUID\-compatible ID, but this is not enforced, and formatted differently\&. Developers can generate a new ID for this purpose with \fBsystemd\-id128 new\fR\&. .RE .PP \fIPRIORITY=\fR .RS 4 A priority value between 0 ("emerg") and 7 ("debug") formatted as a decimal string\&. This field is compatible with syslog\*(Aqs priority concept\&. .RE .PP \fICODE_FILE=\fR, \fICODE_LINE=\fR, \fICODE_FUNC=\fR .RS 4 The code location generating this message, if known\&. Contains the source filename, the line number and the function name\&. .RE .PP \fIERRNO=\fR .RS 4 The low\-level Unix error number causing this entry, if any\&. Contains the numeric value of \fBerrno\fR(3) formatted as a decimal string\&. .sp Added in version 188\&. .RE .PP \fIINVOCATION_ID=\fR, \fIUSER_INVOCATION_ID=\fR .RS 4 A randomized, unique 128\-bit ID identifying each runtime cycle of the unit\&. This is different from \fI_SYSTEMD_INVOCATION_ID\fR in that it is only used for messages coming from systemd code (e\&.g\&. logs from the system/user manager or from forked processes performing systemd\-related setup)\&. .sp Added in version 245\&. .RE .PP \fISYSLOG_FACILITY=\fR, \fISYSLOG_IDENTIFIER=\fR, \fISYSLOG_PID=\fR, \fISYSLOG_TIMESTAMP=\fR .RS 4 Syslog compatibility fields containing the facility (formatted as decimal string), the identifier string (i\&.e\&. "tag"), the client PID, and the timestamp as specified in the original datagram\&. (Note that the tag is usually derived from glibc\*(Aqs \fIprogram_invocation_short_name\fR variable, see \fBprogram_invocation_short_name\fR(3)\&.) .sp Note that the journal service does not validate the values of any structured journal fields whose name is not prefixed with an underscore, and this includes any syslog related fields such as these\&. Hence, applications that supply a facility, PID, or log level are expected to do so properly formatted, i\&.e\&. as numeric integers formatted as decimal strings\&. .RE .PP \fISYSLOG_RAW=\fR .RS 4 The original contents of the syslog line as received in the syslog datagram\&. This field is only included if the \fIMESSAGE=\fR field was modified compared to the original payload or the timestamp could not be located properly and is not included in \fISYSLOG_TIMESTAMP=\fR\&. Message truncation occurs when the message contains leading or trailing whitespace (trailing and leading whitespace is stripped), or it contains an embedded \fBNUL\fR byte (the \fBNUL\fR byte and anything after it is not included)\&. Thus, the original syslog line is either stored as \fISYSLOG_RAW=\fR or it can be recreated based on the stored priority and facility, timestamp, identifier, and the message payload in \fIMESSAGE=\fR\&. .sp Added in version 240\&. .RE .PP \fIDOCUMENTATION=\fR .RS 4 A documentation URL with further information about the topic of the log message\&. Tools such as \fBjournalctl\fR will include a hyperlink to a URL specified this way in their output\&. Should be an "http://", "https://", "file:/", "man:" or "info:" URL\&. .sp Added in version 246\&. .RE .PP \fITID=\fR .RS 4 The numeric thread ID (TID) the log message originates from\&. .sp Added in version 247\&. .RE .PP \fIUNIT=\fR, \fIUSER_UNIT=\fR .RS 4 The name of a unit\&. Used by the system and user managers when logging about specific units\&. .sp When \fB\-\-unit=\fR\fB\fIname\fR\fR or \fB\-\-user\-unit=\fR\fB\fIname\fR\fR are used with \fBjournalctl\fR(1), a match pattern that includes "UNIT=\fIname\fR\&.service" or "USER_UNIT=\fIname\fR\&.service" will be generated\&. .sp Added in version 251\&. .RE .SH "TRUSTED JOURNAL FIELDS" .PP Fields prefixed with an underscore are trusted fields, i\&.e\&. fields that are implicitly added by the journal and cannot be altered by client code\&. .PP \fI_PID=\fR, \fI_UID=\fR, \fI_GID=\fR .RS 4 The process, user, and group ID of the process the journal entry originates from formatted as a decimal string\&. Note that entries obtained via "stdout" or "stderr" of forked processes will contain credentials valid for a parent process (that initiated the connection to \fBsystemd\-journald\fR)\&. .RE .PP \fI_COMM=\fR, \fI_EXE=\fR, \fI_CMDLINE=\fR .RS 4 The name, the executable path, and the command line of the process the journal entry originates from\&. .RE .PP \fI_CAP_EFFECTIVE=\fR .RS 4 The effective \fBcapabilities\fR(7) of the process the journal entry originates from\&. .sp Added in version 206\&. .RE .PP \fI_AUDIT_SESSION=\fR, \fI_AUDIT_LOGINUID=\fR .RS 4 The session and login UID of the process the journal entry originates from, as maintained by the kernel audit subsystem\&. .RE .PP \fI_SYSTEMD_CGROUP=\fR, \fI_SYSTEMD_SLICE=\fR, \fI_SYSTEMD_UNIT=\fR, \fI_SYSTEMD_USER_UNIT=\fR, \fI_SYSTEMD_USER_SLICE=\fR, \fI_SYSTEMD_SESSION=\fR, \fI_SYSTEMD_OWNER_UID=\fR .RS 4 The control group path in the systemd hierarchy, the systemd slice unit name, the systemd unit name, the unit name in the systemd user manager (if any), the systemd session ID (if any), and the owner UID of the systemd user unit or systemd session (if any) of the process the journal entry originates from\&. .RE .PP \fI_SELINUX_CONTEXT=\fR .RS 4 The SELinux security context (label) of the process the journal entry originates from\&. .RE .PP \fI_SOURCE_REALTIME_TIMESTAMP=\fR .RS 4 The earliest trusted timestamp of the message, if any is known that is different from the reception time of the journal\&. This is the time in microseconds since the epoch UTC, formatted as a decimal string\&. .RE .PP \fI_BOOT_ID=\fR .RS 4 The kernel boot ID for the boot the message was generated in, formatted as a 128\-bit hexadecimal string\&. .RE .PP \fI_MACHINE_ID=\fR .RS 4 The machine ID of the originating host, as available in \fBmachine-id\fR(5)\&. .RE .PP \fI_SYSTEMD_INVOCATION_ID=\fR .RS 4 The invocation ID for the runtime cycle of the unit the message was generated in, as available to processes of the unit in \fI$INVOCATION_ID\fR (see \fBsystemd.exec\fR(5))\&. .sp Added in version 233\&. .RE .PP \fI_HOSTNAME=\fR .RS 4 The name of the originating host\&. .RE .PP \fI_TRANSPORT=\fR .RS 4 How the entry was received by the journal service\&. Valid transports are: .PP \fBaudit\fR .RS 4 for those read from the kernel audit subsystem .sp Added in version 227\&. .RE .PP \fBdriver\fR .RS 4 for internally generated messages .sp Added in version 205\&. .RE .PP \fBsyslog\fR .RS 4 for those received via the local syslog socket with the syslog protocol .sp Added in version 205\&. .RE .PP \fBjournal\fR .RS 4 for those received via the native journal protocol .sp Added in version 205\&. .RE .PP \fBstdout\fR .RS 4 for those read from a service\*(Aqs standard output or error output .sp Added in version 205\&. .RE .PP \fBkernel\fR .RS 4 for those read from the kernel .sp Added in version 205\&. .RE .RE .PP \fI_STREAM_ID=\fR .RS 4 Only applies to "_TRANSPORT=stdout" records: specifies a randomized 128\-bit ID assigned to the stream connection when it was first created\&. This ID is useful to reconstruct individual log streams from the log records: all log records carrying the same stream ID originate from the same stream\&. .sp Added in version 235\&. .RE .PP \fI_LINE_BREAK=\fR .RS 4 Only applies to "_TRANSPORT=stdout" records: indicates that the log message in the standard output/error stream was not terminated with a normal newline character ("\en", i\&.e\&. ASCII 10)\&. Specifically, when set this field is one of \fBnul\fR (in case the line was terminated by a \fBNUL\fR byte), \fBline\-max\fR (in case the maximum log line length was reached, as configured with \fILineMax=\fR in \fBjournald.conf\fR(5)), \fBeof\fR (if this was the last log record of a stream and the stream ended without a final newline character), or \fBpid\-change\fR (if the process which generated the log output changed in the middle of a line)\&. Note that this record is not generated when a normal newline character was used for marking the log line end\&. .sp Added in version 235\&. .RE .PP \fI_NAMESPACE=\fR .RS 4 If this file was written by a \fBsystemd\-journald\fR instance managing a journal namespace that is not the default, this field contains the namespace identifier\&. See \fBsystemd-journald.service\fR(8) for details about journal namespaces\&. .sp Added in version 245\&. .RE .PP \fI_RUNTIME_SCOPE=\fR .RS 4 A string field that specifies the runtime scope in which the message was logged\&. If "initrd", the log message was processed while the system was running inside the initrd\&. If "system", the log message was generated after the system switched execution to the host root filesystem\&. .sp Added in version 252\&. .RE .SH "KERNEL JOURNAL FIELDS" .PP Kernel fields are fields that are used by messages originating in the kernel and stored in the journal\&. .PP \fI_KERNEL_DEVICE=\fR .RS 4 The kernel device name\&. If the entry is associated to a block device, contains the major and minor numbers of the device node, separated by ":" and prefixed by "b"\&. Similarly for character devices, but prefixed by "c"\&. For network devices, this is the interface index prefixed by "n"\&. For all other devices, this is the subsystem name prefixed by "+", followed by ":", followed by the kernel device name\&. .sp Added in version 189\&. .RE .PP \fI_KERNEL_SUBSYSTEM=\fR .RS 4 The kernel subsystem name\&. .sp Added in version 189\&. .RE .PP \fI_UDEV_SYSNAME=\fR .RS 4 The kernel device name as it shows up in the device tree below /sys/\&. .sp Added in version 189\&. .RE .PP \fI_UDEV_DEVNODE=\fR .RS 4 The device node path of this device in /dev/\&. .sp Added in version 189\&. .RE .PP \fI_UDEV_DEVLINK=\fR .RS 4 Additional symlink names pointing to the device node in /dev/\&. This field is frequently set more than once per entry\&. .sp Added in version 189\&. .RE .SH "FIELDS TO LOG ON BEHALF OF A DIFFERENT PROGRAM" .PP Fields in this section are used by programs to specify that they are logging on behalf of another program or unit\&. .PP Fields used by the \fBsystemd\-coredump\fR coredump kernel helper: .PP \fICOREDUMP_UNIT=\fR, \fICOREDUMP_USER_UNIT=\fR .RS 4 Used to annotate messages containing coredumps from system and session units\&. See \fBcoredumpctl\fR(1)\&. .sp Added in version 198\&. .RE .PP Privileged programs (currently UID 0) may attach \fIOBJECT_PID=\fR to a message\&. This will instruct \fBsystemd\-journald\fR to attach additional fields on behalf of the caller: .PP \fIOBJECT_PID=\fR\fI\fIPID\fR\fR .RS 4 PID of the program that this message pertains to\&. .sp Added in version 205\&. .RE .PP \fIOBJECT_UID=\fR, \fIOBJECT_GID=\fR, \fIOBJECT_COMM=\fR, \fIOBJECT_EXE=\fR, \fIOBJECT_CMDLINE=\fR, \fIOBJECT_AUDIT_SESSION=\fR, \fIOBJECT_AUDIT_LOGINUID=\fR, \fIOBJECT_SYSTEMD_CGROUP=\fR, \fIOBJECT_SYSTEMD_SESSION=\fR, \fIOBJECT_SYSTEMD_OWNER_UID=\fR, \fIOBJECT_SYSTEMD_UNIT=\fR, \fIOBJECT_SYSTEMD_USER_UNIT=\fR .RS 4 These are additional fields added automatically by \fBsystemd\-journald\fR\&. Their meaning is the same as \fI_UID=\fR, \fI_GID=\fR, \fI_COMM=\fR, \fI_EXE=\fR, \fI_CMDLINE=\fR, \fI_AUDIT_SESSION=\fR, \fI_AUDIT_LOGINUID=\fR, \fI_SYSTEMD_CGROUP=\fR, \fI_SYSTEMD_SESSION=\fR, \fI_SYSTEMD_UNIT=\fR, \fI_SYSTEMD_USER_UNIT=\fR, and \fI_SYSTEMD_OWNER_UID=\fR as described above, except that the process identified by \fIPID\fR is described, instead of the process which logged the message\&. .sp Added in version 205\&. .RE .PP \fIOBJECT_SYSTEMD_INVOCATION_ID=\fR .RS 4 An additional field added automatically by \fBsystemd\-journald\fR\&. The meaning is mostly the same as \fI_SYSTEMD_INVOCATION_ID=\fR, with the difference described above\&. .sp Added in version 235\&. .RE .SH "ADDRESS FIELDS" .PP During serialization into external formats, such as the \m[blue]\fBJournal Export Format\fR\m[]\&\s-2\u[1]\d\s+2 or the \m[blue]\fBJournal JSON Format\fR\m[]\&\s-2\u[2]\d\s+2, the addresses of journal entries are serialized into fields prefixed with double underscores\&. Note that these are not proper fields when stored in the journal but for addressing metadata of entries\&. They cannot be written as part of structured log entries via calls such as \fBsd_journal_send\fR(3)\&. They may also not be used as matches for \fBsd_journal_add_match\fR(3)\&. .PP \fI__CURSOR=\fR .RS 4 The cursor for the entry\&. A cursor is an opaque text string that uniquely describes the position of an entry in the journal and is portable across machines, platforms and journal files\&. .RE .PP \fI__REALTIME_TIMESTAMP=\fR .RS 4 The wallclock time (\fBCLOCK_REALTIME\fR) at the point in time the entry was received by the journal, in microseconds since the epoch UTC, formatted as a decimal string\&. This has different properties from "_SOURCE_REALTIME_TIMESTAMP=", as it is usually a bit later but more likely to be monotonic\&. .RE .PP \fI__MONOTONIC_TIMESTAMP=\fR .RS 4 The monotonic time (\fBCLOCK_MONOTONIC\fR) at the point in time the entry was received by the journal in microseconds, formatted as a decimal string\&. To be useful as an address for the entry, this should be combined with the boot ID in "_BOOT_ID="\&. .RE .PP \fI__SEQNUM=\fR, \fI__SEQNUM_ID=\fR .RS 4 The sequence number (and associated sequence number ID) of this journal entry in the journal file it originates from\&. See \fBsd_journal_get_seqnum\fR(3) for details\&. .sp Added in version 254\&. .RE .SH "SEE ALSO" .PP \fBsystemd\fR(1), \fBsystemd-journald.service\fR(8), \fBjournalctl\fR(1), \fBjournald.conf\fR(5), \fBsd-journal\fR(3), \fBcoredumpctl\fR(1), \fBsystemd.directives\fR(7) .SH "NOTES" .IP " 1." 4 Journal Export Format .RS 4 \%https://systemd.io/JOURNAL_EXPORT_FORMATS#journal-export-format .RE .IP " 2." 4 Journal JSON Format .RS 4 \%https://systemd.io/JOURNAL_EXPORT_FORMATS#journal-json-format .RE