Class SplunkEvent

java.lang.Object
org.apache.camel.component.splunk.event.SplunkEvent
All Implemented Interfaces:
Serializable

public class SplunkEvent extends Object implements Serializable
See Also:
  • Field Details

    • COMMON_CATEGORY

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

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

      public static final String COMMON_DESC
      The free-form description of a particular event.
      See Also:
    • COMMON_DHCP_POOL

      public static final String COMMON_DHCP_POOL
      The name of a given DHCP pool on a DHCP server.
      See Also:
    • COMMON_DURATION

      public static final String COMMON_DURATION
      The amount of time the event lasted.
      See Also:
    • 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:
    • COMMON_DVC_IP

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

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

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

      public static final String COMMON_DVC_MAC
      The MAC (layer 2) address of the device reporting the event.
      See Also:
    • 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:
    • 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:
    • COMMON_DVC_TIME

      public static final String COMMON_DVC_TIME
      Time at which the device recorded the event.
      See Also:
    • COMMON_END_TIME

      public static final String COMMON_END_TIME
      The event's specified end time.
      See Also:
    • 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:
    • COMMON_LENGTH

      public static final String COMMON_LENGTH
      The length of the datagram, event, message, or packet.
      See Also:
    • 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:
    • 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:
    • COMMON_PID

      public static final String COMMON_PID
      An integer assigned by the device operating system to the process creating the record.
      See Also:
    • 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:
    • COMMON_PRODUCT

      public static final String COMMON_PRODUCT
      The product that generated the event.
      See Also:
    • COMMON_PRODUCT_VERSION

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

      public static final String COMMON_REASON
      The result root cause, such as connection refused, timeout, crash, and so on.
      See Also:
    • 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:
    • COMMON_SEVERITY

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

      public static final String COMMON_START_TIME
      The event's specified start time.
      See Also:
    • COMMON_TRANSACTION_ID

      public static final String COMMON_TRANSACTION_ID
      The transaction identifier.
      See Also:
    • COMMON_URL

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

      public static final String COMMON_VENDOR
      The vendor who made the product that generated the event.
      See Also:
    • LINEBREAK

      public static final String LINEBREAK
      Event break delimiter
      See Also:
    • UPDATE_PACKAGE

      public static final String UPDATE_PACKAGE
      The name of the installed update.
      See Also:
  • Constructor Details

    • 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 Details

    • getEventData

      public Map<String,String> getEventData()
    • 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)