Enum Class JournalField

java.lang.Object
java.lang.Enum<JournalField>
org.metabit.platform.interfacing.jjournal.JournalField
All Implemented Interfaces:
Serializable, Comparable<JournalField>, Constable

public enum JournalField extends Enum<JournalField>
class for predefined, standard Journald-fieldnames. the string value needs to be the precise character sequence of the respective field. The enum name may be different, improving on abbreviations or the like.

see https://www.man7.org/linux/man-pages/man7/systemd.journal-fields.7.html for the man pages

Version:
$Id: $Id
  • Enum Constant Details

    • MESSAGE

      public static final JournalField 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

      public static final JournalField 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

      public static final JournalField 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

      public static final JournalField CODE_FILE
      The code location generating this message, if known. Contains the source filename, the line number and the function name.
    • CODE_LINE

      public static final JournalField CODE_LINE
    • CODE_FUNC

      public static final JournalField CODE_FUNC
    • ERRNO

      public static final JournalField 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

      public static final JournalField 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

      public static final JournalField USER_INVOCATION_ID
    • SYSLOG_FACILITY

      public static final JournalField 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

      public static final JournalField SYSLOG_IDENTIFIER
    • SYSLOG_PID

      public static final JournalField SYSLOG_PID
    • SYSLOG_TIMESTAMP

      public static final JournalField SYSLOG_TIMESTAMP
    • SYSLOG_RAW

      public static final JournalField 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

      public static final JournalField 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

      public static final JournalField THREAD_ID
      The numeric thread ID (TID) the log message originates from.
    • PROCESS_ID

      public static final JournalField 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

      public static final JournalField USER_ID
    • GROUP_ID

      public static final JournalField GROUP_ID
    • PROCESS_COMMAND

      public static final JournalField 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

      public static final JournalField PROCESS_EXECUTABLE_WITH_PATH
    • PROCESS_COMMAND_LINE

      public static final JournalField PROCESS_COMMAND_LINE
    • PROCESS_EFFECTIVE_CAPABILITIES

      public static final JournalField PROCESS_EFFECTIVE_CAPABILITIES
      The effective capabilities(7) of the process the journal entry originates from.
    • AUDIT_SESSION

      public static final JournalField AUDIT_SESSION
      The session and login UID of the process the journal entry originates from, as maintained by the kernel audit subsystem.
    • AUDIT_LOGINUID

      public static final JournalField AUDIT_LOGINUID
    • SYSTEMD_CGROUP

      public static final JournalField 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

      public static final JournalField SYSTEMD_SLICE
    • SYSTEMD_UNIT

      public static final JournalField SYSTEMD_UNIT
    • SYSTEMD_USER_UNIT

      public static final JournalField SYSTEMD_USER_UNIT
    • SYSTEMD_USER_SLICE

      public static final JournalField SYSTEMD_USER_SLICE
    • SYSTEMD_SESSION

      public static final JournalField SYSTEMD_SESSION
    • SYSTEMD_OWNER_UID

      public static final JournalField SYSTEMD_OWNER_UID
    • SELINUX_CONTEXT

      public static final JournalField SELINUX_CONTEXT
      The SELinux security context (label) of the process the journal entry originates from.
    • SOURCE_REALTIME_TIMESTAMP

      public static final JournalField 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

      public static final JournalField BOOT_ID
      The kernel boot ID for the boot the message was generated in, formatted as a 128-bit hexadecimal string.
    • MACHINE_ID

      public static final JournalField MACHINE_ID
      The machine ID of the originating host, as available in machine-id(5).
    • SYSTEMD_INVOCATION_ID

      public static final JournalField SYSTEMD_INVOCATION_ID
      the systemd invocation ID, see systemd.exec(5)
    • HOSTNAME

      public static final JournalField HOSTNAME
      The name of the originating host.
    • TRANSPORT

      public static final JournalField 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

      public static final JournalField 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

      public static final JournalField 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

      public static final JournalField NAMESPACE
      when a non-default journal namespace is used, this contains the namespace identifier. See systemd-journald.service(8) about namespaces.
    • KERNEL_DEVICE

      public static final JournalField KERNEL_DEVICE
    • KERNEL_SUBSYSTEM

      public static final JournalField KERNEL_SUBSYSTEM
    • KERNEL_UDEV_SYSNAME

      public static final JournalField KERNEL_UDEV_SYSNAME
    • KERNEL_UDEV_DEVNOCE

      public static final JournalField KERNEL_UDEV_DEVNOCE
    • COREDUMP_UNIT

      public static final JournalField COREDUMP_UNIT
      see coredumpctl(1) for how the systemd-coredump kernel helper uses these.
    • COREDUMP_USER_UNIT

      public static final JournalField COREDUMP_USER_UNIT
    • OBJECT_PID

      public static final JournalField 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

      public static final JournalField OBJECT_UID
    • OBJECT_GID

      public static final JournalField OBJECT_GID
    • OBJECT_COMM

      public static final JournalField OBJECT_COMM
    • OBJECT_EXE

      public static final JournalField OBJECT_EXE
    • OBJECT_CMDLINE

      public static final JournalField OBJECT_CMDLINE
    • OBJECT_AUDIT_SESSION

      public static final JournalField OBJECT_AUDIT_SESSION
    • OBJECT_AUDIT_LOGINUID

      public static final JournalField OBJECT_AUDIT_LOGINUID
    • OBJECT_SYSTEMD_CGROUP

      public static final JournalField OBJECT_SYSTEMD_CGROUP
    • OBJECT_SYSTEMD_SESSION

      public static final JournalField OBJECT_SYSTEMD_SESSION
    • OBJECT_SYSTEMD_OWNER_UID

      public static final JournalField OBJECT_SYSTEMD_OWNER_UID
    • OBJECT_SYSTEMD_UNIT

      public static final JournalField OBJECT_SYSTEMD_UNIT
    • OBJECT_SYSTEMD_USER_UNIT

      public static final JournalField OBJECT_SYSTEMD_USER_UNIT
  • Field Details

    • JOURNAL_FIELD_NAME_VALIDITY_PATTERN

      public static final String 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

      private static final Pattern validFieldNameCheck
    • type

      private final JournalField.DataType type
    • value

      private final String value
    • reverseMap

      private static final Map<String,JournalField> reverseMap
  • Constructor Details

  • Method Details

    • values

      public static JournalField[] 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

      public static JournalField valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • getValue

      public String getValue()
      get the actual string value of the field.
      Returns:
      the JournalD field name as string (not the enum name).
    • getType

      public JournalField.DataType getType()
      get the type of the field.
      Returns:
      type, as enum local to this.
    • lookup

      public static JournalField lookup(String fieldName)
      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

      public static boolean checkFieldNameValidity(String stringToTest)

      checkFieldNameValidity.

      Parameters:
      stringToTest - a String object
      Returns:
      a boolean