Enum Class JournalField
- All Implemented Interfaces:
Serializable,Comparable<JournalField>,Constable
see https://www.man7.org/linux/man-pages/man7/systemd.journal-fields.7.html for the man pages
- Version:
- $Id: $Id
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe session and login UID of the process the journal entry originates from, as maintained by the kernel audit subsystem.The kernel boot ID for the boot the message was generated in, formatted as a 128-bit hexadecimal string.The code location generating this message, if known.see coredumpctl(1) for how the systemd-coredump kernel helper uses these.A documentation URL with further information about the topic of the log message.The low-level Unix error number causing this entry, if any.The name of the originating host.A randomized, unique 128-bit ID identifying each runtime cycle of the unit.The machine ID of the originating host, as available in machine-id(5).The human-readable message string for this entry.A 128-bit message identifier ID for recognizing certain message types, if this is desirable.when a non-default journal namespace is used, this contains the namespace identifier.these fields may be attached by privileged programs (e.g.A priority value between 0 ("emerg") and 7 ("debug") formatted as a decimal string.trusted fields (implicitly added by the journald)The effective capabilities(7) of the process the journal entry originates from.The so-called "trusted journal fields" are those added automatically by the journal system.The SELinux security context (label) of the process the journal entry originates from.The earliest trusted timestamp of the message, if any is known that is different from the reception time of the journal.JW only valid for transport "stdout", hence the name.the "stream ID" applies only to stdout _TRANSPORT record.Syslog compatibility fields containing the facility (formatted as decimal string), the identifier string (i.e.The original contents of the syslog line as received in the syslog datagram.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.the systemd invocation ID, see systemd.exec(5)The numeric thread ID (TID) the log message originates from.How the entry was received by the journal service. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringfrom man sd_journal_send: "The variable name must be in uppercase and consist only of characters, numbers and underscores, and may not begin with an underscore." but for reading, the underscore rule is not valid; there are many automatically generated fields starting with an underscore.private static final Map<String, JournalField> private final JournalField.DataTypeprivate static final Patternprivate final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancheckFieldNameValidity(String stringToTest) checkFieldNameValidity.getType()get the type of the field.getValue()get the actual string value of the field.static JournalFieldlookup a field by provided journal field name.static JournalFieldReturns the enum constant of this class with the specified name.static JournalField[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
MESSAGE
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. -
MESSAGE_ID
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 systemd-id128 new. -
PRIORITY
A priority value between 0 ("emerg") and 7 ("debug") formatted as a decimal string. This field is compatible with syslog's priority concept. -
CODE_FILE
The code location generating this message, if known. Contains the source filename, the line number and the function name. -
CODE_LINE
-
CODE_FUNC
-
ERRNO
The low-level Unix error number causing this entry, if any. Contains the numeric value of errno(3) formatted as a decimal string. -
INVOCATION_ID
A randomized, unique 128-bit ID identifying each runtime cycle of the unit. This is different from _SYSTEMD_INVOCATION_ID 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). -
USER_INVOCATION_ID
-
SYSLOG_FACILITY
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's program_invocation_short_name variable, see program_invocation_short_name(3).)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.
-
SYSLOG_IDENTIFIER
-
SYSLOG_PID
-
SYSLOG_TIMESTAMP
-
SYSLOG_RAW
The original contents of the syslog line as received in the syslog datagram. This field is only included if the MESSAGE= field was modified compared to the original payload or the timestamp could not be located properly and is not included in SYSLOG_TIMESTAMP=. Message truncation occurs when when the message contains leading or trailing whitespace (trailing and leading whitespace is stripped), or it contains an embedded NUL byte (the NUL byte and anything after it is not included). Thus, the original syslog line is either stored as SYSLOG_RAW= or it can be recreated based on the stored priority and facility, timestamp, identifier, and the message payload in MESSAGE=. -
DOCUMENTATION
A documentation URL with further information about the topic of the log message. Tools such as journalctl will include a hyperlink to an URL specified this way in their output. Should be a "http://", "https://", "file:/", "man:" or "info:" URL. -
THREAD_ID
The numeric thread ID (TID) the log message originates from. -
PROCESS_ID
The so-called "trusted journal fields" are those added automatically by the journal system. They cannot be altered by client code, and so they are considered "trusted". Their field names start with an underscore.trusted fields (implicitly added by the journald)
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 systemd-journald).
-
USER_ID
-
GROUP_ID
-
PROCESS_COMMAND
trusted fields (implicitly added by the journald)of the process that caused this journal entry, its process executable name process executable path process executable full command line
-
PROCESS_EXECUTABLE_WITH_PATH
-
PROCESS_COMMAND_LINE
-
PROCESS_EFFECTIVE_CAPABILITIES
The effective capabilities(7) of the process the journal entry originates from. -
AUDIT_SESSION
The session and login UID of the process the journal entry originates from, as maintained by the kernel audit subsystem. -
AUDIT_LOGINUID
-
SYSTEMD_CGROUP
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. -
SYSTEMD_SLICE
-
SYSTEMD_UNIT
-
SYSTEMD_USER_UNIT
-
SYSTEMD_USER_SLICE
-
SYSTEMD_SESSION
-
SYSTEMD_OWNER_UID
-
SELINUX_CONTEXT
The SELinux security context (label) of the process the journal entry originates from. -
SOURCE_REALTIME_TIMESTAMP
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. -
BOOT_ID
The kernel boot ID for the boot the message was generated in, formatted as a 128-bit hexadecimal string. -
MACHINE_ID
The machine ID of the originating host, as available in machine-id(5). -
SYSTEMD_INVOCATION_ID
the systemd invocation ID, see systemd.exec(5) -
HOSTNAME
The name of the originating host. -
TRANSPORT
How the entry was received by the journal service. Valid transports are: audit - for those read from the kernel audit subsystem driver - for internally generated messages syslog - for those received via the local syslog socket with the syslog protocol journal - for those received via the native journal protocol stdout - for those read from a service's standard output or error output kernel - for those read from the kernel -
STDOUT_STREAM_ID
the "stream ID" applies only to stdout _TRANSPORT record. it is a random 128 bit ID of the stream connection. This may be useful to reconstruct streams; all records with the same streamID originate from the same stream. -
STDOUT_LINE_BREAK
JW only valid for transport "stdout", hence the name. when the log message in the output / error stream was not terminated with an normal "\n" = ASCII 10 newline, this tells us what else was used. when the normal newline is used, this record is not set. defined values: * "nul" when the line was terminated with ASCII NUL byte (0x00). * "line-max" when the maximum line length (as configuredwith LineMax= in journald.conf(5) ) was reached. * "eof" when the stream ended without a final newline character. * "pid-change" when the process sending the output changed in the middle of a line / before line end. -
NAMESPACE
when a non-default journal namespace is used, this contains the namespace identifier. See systemd-journald.service(8) about namespaces. -
KERNEL_DEVICE
-
KERNEL_SUBSYSTEM
-
KERNEL_UDEV_SYSNAME
-
KERNEL_UDEV_DEVNOCE
-
KERNEL_UDEV_DEVLINK
-
COREDUMP_UNIT
see coredumpctl(1) for how the systemd-coredump kernel helper uses these. -
COREDUMP_USER_UNIT
-
OBJECT_PID
these fields may be attached by privileged programs (e.g. UID0) to provide additionl information about where journal entries originated from -
OBJECT_UID
-
OBJECT_GID
-
OBJECT_COMM
-
OBJECT_EXE
-
OBJECT_CMDLINE
-
OBJECT_AUDIT_SESSION
-
OBJECT_AUDIT_LOGINUID
-
OBJECT_SYSTEMD_CGROUP
-
OBJECT_SYSTEMD_SESSION
-
OBJECT_SYSTEMD_OWNER_UID
-
OBJECT_SYSTEMD_UNIT
-
OBJECT_SYSTEMD_USER_UNIT
-
-
Field Details
-
JOURNAL_FIELD_NAME_VALIDITY_PATTERN
from man sd_journal_send: "The variable name must be in uppercase and consist only of characters, numbers and underscores, and may not begin with an underscore." but for reading, the underscore rule is not valid; there are many automatically generated fields starting with an underscore. (It's reserved to them, that's the reason for above restriction.)- See Also:
-
validFieldNameCheck
-
type
-
value
-
reverseMap
-
-
Constructor Details
-
JournalField
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getValue
get the actual string value of the field.- Returns:
- the JournalD field name as string (not the enum name).
-
getType
get the type of the field.- Returns:
- type, as enum local to this.
-
lookup
lookup a field by provided journal field name. use this, not valueOf() to map strings back to enums- Parameters:
fieldName- as provided by journal- Returns:
- field enum
- Throws:
IllegalArgumentException- if the string provided does not have a corresponding field enum entry.
-
checkFieldNameValidity
checkFieldNameValidity.
- Parameters:
stringToTest- aStringobject- Returns:
- a boolean
-