org.apache.camel.component.splunk.event
Class SplunkEvent

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

public class SplunkEvent
extends Object
implements Serializable

See Also:
Serialized Form

Field Summary
static String COMMON_CATEGORY
          A device-specific classification provided as part of the event.
static String COMMON_COUNT
          A device-specific classification provided as part of the event.
static String COMMON_DESC
          The free-form description of a particular event.
static String COMMON_DHCP_POOL
          The name of a given DHCP pool on a DHCP server.
static String COMMON_DURATION
          The amount of time the event lasted.
static String COMMON_DVC_HOST
          The fully qualified domain name of the device transmitting or recording the log record.
static String COMMON_DVC_IP
          The IPv4 address of the device reporting the event.
static String COMMON_DVC_IP6
          The IPv6 address of the device reporting the event.
static String COMMON_DVC_LOCATION
          The free-form description of the device's physical location.
static String COMMON_DVC_MAC
          The MAC (layer 2) address of the device reporting the event.
static String COMMON_DVC_NT_DOMAIN
          The Windows NT domain of the device recording or transmitting the event.
static String COMMON_DVC_NT_HOST
          The Windows NT host name of the device recording or transmitting the event.
static String COMMON_DVC_TIME
          Time at which the device recorded the event.
static String COMMON_END_TIME
          The event's specified end time.
static String COMMON_EVENT_ID
          A unique identifier that identifies the event.
static String COMMON_LENGTH
          The length of the datagram, event, message, or packet.
static String COMMON_LOG_LEVEL
          The log-level that was set on the device and recorded in the event.
static String COMMON_NAME
          The name of the event as reported by the device.
static String COMMON_PID
          An integer assigned by the device operating system to the process creating the record.
static 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.
static String COMMON_PRODUCT
          The product that generated the event.
static String COMMON_PRODUCT_VERSION
          The version of the product that generated the event.
static String COMMON_REASON
          The result root cause, such as connection refused, timeout, crash, and so on.
static String COMMON_RESULT
          The action result.
static String COMMON_SEVERITY
          The severity (or priority) of an event as reported by the originating device.
static String COMMON_START_TIME
          The event's specified start time.
static String COMMON_TRANSACTION_ID
          The transaction identifier.
static String COMMON_URL
          A uniform record locator (a web address, in other words) included in a record.
static String COMMON_VENDOR
          The vendor who made the product that generated the event.
static String UPDATE_PACKAGE
          The name of the installed update.
 
Constructor Summary
SplunkEvent()
          Default constructor
SplunkEvent(Map<String,String> data)
          A Constructor to load data from a Map
SplunkEvent(SplunkEvent splunkEvent)
          A Copy constructor
SplunkEvent(String eventName, String eventID)
          Constructor to create a generic event with the default format
SplunkEvent(String eventName, String eventID, boolean useInternalDate, boolean quoteValues)
          Constructor to create a generic event
 
Method Summary
 void addPair(String key, boolean value)
          Add a key value pair
 void addPair(String key, char value)
          Add a key value pair
 void addPair(String key, double value)
          Add a key value pair
 void addPair(String key, int value)
          Add a key value pair
 void addPair(String key, long value)
          Add a key value pair
 void addPair(String key, Object value)
          Add a key value pair
 void addPair(String key, String value)
          Add a key value pair
 void addThrowable(Throwable throwable)
          Utility method for formatting Throwable,Error,Exception objects in a more linear and Splunk friendly manner than printStackTrace
 void addThrowable(Throwable throwable, int stackTraceDepth)
          Utility method for formatting Throwable,Error,Exception objects in a more linear and Splunk friendly manner than printStackTrace
 Map<String,String> getEventData()
           
 void setCommonCategory(String commonCategory)
           
 void setCommonCount(String commonCount)
           
 void setCommonDesc(String commonDesc)
           
 void setCommonDhcpPool(String commonDhcpPool)
           
 void setCommonDuration(long commonDuration)
           
 void setCommonDvcHost(String commonDvcHost)
           
 void setCommonDvcIp(String commonDvcIp)
           
 void setCommonDvcIp6(String commonDvcIp6)
           
 void setCommonDvcLocation(String commonDvcLocation)
           
 void setCommonDvcMac(String commonDvcMac)
           
 void setCommonDvcNtDomain(String commonDvcNtDomain)
           
 void setCommonDvcNtHost(String commonDvcNtHost)
           
 void setCommonDvcTime(long commonDvcTime)
           
 void setCommonEndTime(long commonEndTime)
           
 void setCommonEventId(long commonEventId)
           
 void setCommonLength(long commonLength)
           
 void setCommonLogLevel(String commonLogLevel)
           
 void setCommonName(String commonName)
           
 void setCommonPid(long commonPid)
           
 void setCommonPriority(long commonPriority)
           
 void setCommonProduct(String commonProduct)
           
 void setCommonProductVersion(long commonProductVersion)
           
 void setCommonReason(String commonReason)
           
 void setCommonResult(String commonResult)
           
 void setCommonSeverity(String commonSeverity)
           
 void setCommonStartTime(long commonStartTime)
           
 void setCommonTransactionId(String commonTransactionId)
           
 void setCommonUrl(String commonUrl)
           
 void setCommonVendor(String commonVendor)
           
 void setUpdatePackage(String updatePackage)
           
 String toString()
          return the completed event message
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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_DESC

public static final String COMMON_DESC
The free-form description of a particular 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_DURATION

public static final String COMMON_DURATION
The amount of time the event lasted.

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_END_TIME

public static final String COMMON_END_TIME
The event's specified end time.

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

public static final String COMMON_PRODUCT
The product that generated the event.

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_START_TIME

public static final String COMMON_START_TIME
The event's specified start time.

See Also:
Constant Field Values

COMMON_TRANSACTION_ID

public static final String COMMON_TRANSACTION_ID
The transaction identifier.

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

UPDATE_PACKAGE

public static final String UPDATE_PACKAGE
The name of the installed update.

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

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)


Apache Camel