Class SplunkEvent

    • Field Detail

      • COMMON_CATEGORY

        public static final String COMMON_CATEGORY
        A device-specific classification provided as part of the event.
        See Also:
        Constant Field Values
      • COMMON_COUNT

        public static final String COMMON_COUNT
        A device-specific classification provided as part of the event.
        See Also:
        Constant Field Values
      • COMMON_DHCP_POOL

        public static final String COMMON_DHCP_POOL
        The name of a given DHCP pool on a DHCP server.
        See Also:
        Constant Field Values
      • COMMON_DVC_HOST

        public static final String COMMON_DVC_HOST
        The fully qualified domain name of the device transmitting or recording the log record.
        See Also:
        Constant Field Values
      • COMMON_DVC_IP

        public static final String COMMON_DVC_IP
        The IPv4 address of the device reporting the event.
        See Also:
        Constant Field Values
      • COMMON_DVC_IP6

        public static final String COMMON_DVC_IP6
        The IPv6 address of the device reporting the event.
        See Also:
        Constant Field Values
      • COMMON_DVC_LOCATION

        public static final String COMMON_DVC_LOCATION
        The free-form description of the device's physical location.
        See Also:
        Constant Field Values
      • COMMON_DVC_MAC

        public static final String COMMON_DVC_MAC
        The MAC (layer 2) address of the device reporting the event.
        See Also:
        Constant Field Values
      • COMMON_DVC_NT_DOMAIN

        public static final String COMMON_DVC_NT_DOMAIN
        The Windows NT domain of the device recording or transmitting the event.
        See Also:
        Constant Field Values
      • COMMON_DVC_NT_HOST

        public static final String COMMON_DVC_NT_HOST
        The Windows NT host name of the device recording or transmitting the event.
        See Also:
        Constant Field Values
      • COMMON_DVC_TIME

        public static final String COMMON_DVC_TIME
        Time at which the device recorded the event.
        See Also:
        Constant Field Values
      • COMMON_EVENT_ID

        public static final String COMMON_EVENT_ID
        A unique identifier that identifies the event. This is unique to the reporting device.
        See Also:
        Constant Field Values
      • COMMON_LENGTH

        public static final String COMMON_LENGTH
        The length of the datagram, event, message, or packet.
        See Also:
        Constant Field Values
      • COMMON_LOG_LEVEL

        public static final String COMMON_LOG_LEVEL
        The log-level that was set on the device and recorded in the event.
        See Also:
        Constant Field Values
      • COMMON_NAME

        public static final String COMMON_NAME
        The name of the event as reported by the device. The name should not contain information that's already being parsed into other fields from the event, such as IP addresses.
        See Also:
        Constant Field Values
      • COMMON_PID

        public static final String COMMON_PID
        An integer assigned by the device operating system to the process creating the record.
        See Also:
        Constant Field Values
      • COMMON_PRIORITY

        public static final String COMMON_PRIORITY
        An environment-specific assessment of the event's importance, based on elements such as event severity, business function of the affected system, or other locally defined variables.
        See Also:
        Constant Field Values
      • COMMON_PRODUCT_VERSION

        public static final String COMMON_PRODUCT_VERSION
        The version of the product that generated the event.
        See Also:
        Constant Field Values
      • COMMON_REASON

        public static final String COMMON_REASON
        The result root cause, such as connection refused, timeout, crash, and so on.
        See Also:
        Constant Field Values
      • COMMON_RESULT

        public static final String COMMON_RESULT
        The action result. Often is a binary choice: succeeded and failed, allowed and denied, and so on.
        See Also:
        Constant Field Values
      • COMMON_SEVERITY

        public static final String COMMON_SEVERITY
        The severity (or priority) of an event as reported by the originating device.
        See Also:
        Constant Field Values
      • COMMON_URL

        public static final String COMMON_URL
        A uniform record locator (a web address, in other words) included in a record.
        See Also:
        Constant Field Values
      • COMMON_VENDOR

        public static final String COMMON_VENDOR
        The vendor who made the product that generated the event.
        See Also:
        Constant Field Values
    • Constructor Detail

      • SplunkEvent

        public SplunkEvent​(Map<String,​String> data)
        A Constructor to load data from a Map
        Parameters:
        data - the map
      • SplunkEvent

        public SplunkEvent​(SplunkEvent splunkEvent)
        A Copy constructor
      • SplunkEvent

        public SplunkEvent​(String eventName,
                           String eventID,
                           boolean useInternalDate,
                           boolean quoteValues)
        Constructor to create a generic event
        Parameters:
        eventName - the event name
        eventID - the event id
        useInternalDate - whether or not to add a date to the event string
        quoteValues - whether or not to put quotes around values
      • SplunkEvent

        public SplunkEvent​(String eventName,
                           String eventID)
        Constructor to create a generic event with the default format
        Parameters:
        eventName - the event name
        eventID - the event ID
      • SplunkEvent

        public SplunkEvent()
        Default constructor
    • Method Detail

      • addPair

        public void addPair​(String key,
                            char value)
        Add a key value pair
      • addPair

        public void addPair​(String key,
                            boolean value)
        Add a key value pair
      • addPair

        public void addPair​(String key,
                            double value)
        Add a key value pair
      • addPair

        public void addPair​(String key,
                            long value)
        Add a key value pair
      • addPair

        public void addPair​(String key,
                            int value)
        Add a key value pair
      • addPair

        public void addPair​(String key,
                            Object value)
        Add a key value pair
      • addThrowable

        public void addThrowable​(Throwable throwable)
        Utility method for formatting Throwable,Error,Exception objects in a more linear and Splunk friendly manner than printStackTrace
        Parameters:
        throwable - the Throwable object to add to the event
      • addThrowable

        public void addThrowable​(Throwable throwable,
                                 int stackTraceDepth)
        Utility method for formatting Throwable,Error,Exception objects in a more linear and Splunk friendly manner than printStackTrace
        Parameters:
        throwable - the Throwable object to add to the event
        stackTraceDepth - maximum number of stacktrace elements to log
      • addPair

        public void addPair​(String key,
                            String value)
        Add a key value pair
      • toString

        public String toString()
        return the completed event message
        Overrides:
        toString in class Object
      • setCommonCategory

        public void setCommonCategory​(String commonCategory)
      • setCommonCount

        public void setCommonCount​(String commonCount)
      • setCommonDesc

        public void setCommonDesc​(String commonDesc)
      • setCommonDhcpPool

        public void setCommonDhcpPool​(String commonDhcpPool)
      • setCommonDuration

        public void setCommonDuration​(long commonDuration)
      • setCommonDvcHost

        public void setCommonDvcHost​(String commonDvcHost)
      • setCommonDvcIp

        public void setCommonDvcIp​(String commonDvcIp)
      • setCommonDvcIp6

        public void setCommonDvcIp6​(String commonDvcIp6)
      • setCommonDvcLocation

        public void setCommonDvcLocation​(String commonDvcLocation)
      • setCommonDvcMac

        public void setCommonDvcMac​(String commonDvcMac)
      • setCommonDvcNtDomain

        public void setCommonDvcNtDomain​(String commonDvcNtDomain)
      • setCommonDvcNtHost

        public void setCommonDvcNtHost​(String commonDvcNtHost)
      • setCommonDvcTime

        public void setCommonDvcTime​(long commonDvcTime)
      • setCommonEndTime

        public void setCommonEndTime​(long commonEndTime)
      • setCommonEventId

        public void setCommonEventId​(long commonEventId)
      • setCommonLength

        public void setCommonLength​(long commonLength)
      • setCommonLogLevel

        public void setCommonLogLevel​(String commonLogLevel)
      • setCommonName

        public void setCommonName​(String commonName)
      • setCommonPid

        public void setCommonPid​(long commonPid)
      • setCommonPriority

        public void setCommonPriority​(long commonPriority)
      • setCommonProduct

        public void setCommonProduct​(String commonProduct)
      • setCommonProductVersion

        public void setCommonProductVersion​(long commonProductVersion)
      • setCommonReason

        public void setCommonReason​(String commonReason)
      • setCommonResult

        public void setCommonResult​(String commonResult)
      • setCommonSeverity

        public void setCommonSeverity​(String commonSeverity)
      • setCommonStartTime

        public void setCommonStartTime​(long commonStartTime)
      • setCommonTransactionId

        public void setCommonTransactionId​(String commonTransactionId)
      • setCommonUrl

        public void setCommonUrl​(String commonUrl)
      • setCommonVendor

        public void setCommonVendor​(String commonVendor)
      • setUpdatePackage

        public void setUpdatePackage​(String updatePackage)