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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringCOMMON_CATEGORYA device-specific classification provided as part of the event.static StringCOMMON_COUNTA device-specific classification provided as part of the event.static StringCOMMON_DESCThe free-form description of a particular event.static StringCOMMON_DHCP_POOLThe name of a given DHCP pool on a DHCP server.static StringCOMMON_DURATIONThe amount of time the event lasted.static StringCOMMON_DVC_HOSTThe fully qualified domain name of the device transmitting or recording the log record.static StringCOMMON_DVC_IPThe IPv4 address of the device reporting the event.static StringCOMMON_DVC_IP6The IPv6 address of the device reporting the event.static StringCOMMON_DVC_LOCATIONThe free-form description of the device's physical location.static StringCOMMON_DVC_MACThe MAC (layer 2) address of the device reporting the event.static StringCOMMON_DVC_NT_DOMAINThe Windows NT domain of the device recording or transmitting the event.static StringCOMMON_DVC_NT_HOSTThe Windows NT host name of the device recording or transmitting the event.static StringCOMMON_DVC_TIMETime at which the device recorded the event.static StringCOMMON_END_TIMEThe event's specified end time.static StringCOMMON_EVENT_IDA unique identifier that identifies the event.static StringCOMMON_LENGTHThe length of the datagram, event, message, or packet.static StringCOMMON_LOG_LEVELThe log-level that was set on the device and recorded in the event.static StringCOMMON_NAMEThe name of the event as reported by the device.static StringCOMMON_PIDAn integer assigned by the device operating system to the process creating the record.static StringCOMMON_PRIORITYAn 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 StringCOMMON_PRODUCTThe product that generated the event.static StringCOMMON_PRODUCT_VERSIONThe version of the product that generated the event.static StringCOMMON_REASONThe result root cause, such as connection refused, timeout, crash, and so on.static StringCOMMON_RESULTThe action result.static StringCOMMON_SEVERITYThe severity (or priority) of an event as reported by the originating device.static StringCOMMON_START_TIMEThe event's specified start time.static StringCOMMON_TRANSACTION_IDThe transaction identifier.static StringCOMMON_URLA uniform record locator (a web address, in other words) included in a record.static StringCOMMON_VENDORThe vendor who made the product that generated the event.static StringLINEBREAKEvent break delimiterstatic StringUPDATE_PACKAGEThe name of the installed update.
-
Constructor Summary
Constructors Constructor Description SplunkEvent()Default constructorSplunkEvent(String eventName, String eventID)Constructor to create a generic event with the default formatSplunkEvent(String eventName, String eventID, boolean useInternalDate, boolean quoteValues)Constructor to create a generic eventSplunkEvent(Map<String,String> data)A Constructor to load data from a MapSplunkEvent(SplunkEvent splunkEvent)A Copy constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPair(String key, boolean value)Add a key value pairvoidaddPair(String key, char value)Add a key value pairvoidaddPair(String key, double value)Add a key value pairvoidaddPair(String key, int value)Add a key value pairvoidaddPair(String key, long value)Add a key value pairvoidaddPair(String key, Object value)Add a key value pairvoidaddPair(String key, String value)Add a key value pairvoidaddThrowable(Throwable throwable)Utility method for formatting Throwable,Error,Exception objects in a more linear and Splunk friendly manner than printStackTracevoidaddThrowable(Throwable throwable, int stackTraceDepth)Utility method for formatting Throwable,Error,Exception objects in a more linear and Splunk friendly manner than printStackTraceMap<String,String>getEventData()voidsetCommonCategory(String commonCategory)voidsetCommonCount(String commonCount)voidsetCommonDesc(String commonDesc)voidsetCommonDhcpPool(String commonDhcpPool)voidsetCommonDuration(long commonDuration)voidsetCommonDvcHost(String commonDvcHost)voidsetCommonDvcIp(String commonDvcIp)voidsetCommonDvcIp6(String commonDvcIp6)voidsetCommonDvcLocation(String commonDvcLocation)voidsetCommonDvcMac(String commonDvcMac)voidsetCommonDvcNtDomain(String commonDvcNtDomain)voidsetCommonDvcNtHost(String commonDvcNtHost)voidsetCommonDvcTime(long commonDvcTime)voidsetCommonEndTime(long commonEndTime)voidsetCommonEventId(long commonEventId)voidsetCommonLength(long commonLength)voidsetCommonLogLevel(String commonLogLevel)voidsetCommonName(String commonName)voidsetCommonPid(long commonPid)voidsetCommonPriority(long commonPriority)voidsetCommonProduct(String commonProduct)voidsetCommonProductVersion(long commonProductVersion)voidsetCommonReason(String commonReason)voidsetCommonResult(String commonResult)voidsetCommonSeverity(String commonSeverity)voidsetCommonStartTime(long commonStartTime)voidsetCommonTransactionId(String commonTransactionId)voidsetCommonUrl(String commonUrl)voidsetCommonVendor(String commonVendor)voidsetUpdatePackage(String updatePackage)StringtoString()return the completed event message
-
-
-
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
-
LINEBREAK
public static final String LINEBREAK
Event break delimiter- 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 nameeventID- the event iduseInternalDate- whether or not to add a date to the event stringquoteValues- 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 nameeventID- 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
-
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 eventstackTraceDepth- maximum number of stacktrace elements to log
-
toString
public String toString()
return the completed event message
-
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)
-
-