|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.AbstractMap<K,V> java.util.HashMap<java.lang.String,java.lang.String> com.splunk.Event
public class Event
The Event
class wraps an individual event or result that was returned
by the ResultsReader.getNextEvent()
method.
An event maps each field name to a list of zero of more values.
These values can be accessed as either an array (using the getArray(java.lang.String)
method) or as a delimited string (using the get(java.lang.String)
method). We
recommend accessing values as an array when possible.
The delimiter for field values depends on the underlying result format.
If the underlying format does not specify a delimiter, such as with the
ResultsReaderXml
class, the delimiter is a comma (,).
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.util.AbstractMap |
---|
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V> |
Method Summary | |
---|---|
void |
clear()
|
java.lang.Object |
clone()
|
java.lang.String |
get(java.lang.String key)
Returns the single value or delimited set of values for the specified field name, or null if the specified field is not present. |
java.lang.String[] |
getArray(java.lang.String key)
Gets the values for the specified field name. |
java.lang.String[] |
getArray(java.lang.String key,
java.lang.String delimiter)
Gets the values for the specified field name. |
java.lang.String |
getSegmentedRaw()
Gets the XML markup for the "_raw" field value. |
java.lang.String |
put(java.lang.String key,
java.lang.String value)
|
void |
putAll(java.util.Map<? extends java.lang.String,? extends java.lang.String> m)
|
java.lang.String |
remove(java.lang.Object key)
|
Methods inherited from class java.util.HashMap |
---|
containsKey, containsValue, entrySet, get, isEmpty, keySet, size, values |
Methods inherited from class java.util.AbstractMap |
---|
equals, hashCode, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
---|
equals, hashCode |
Method Detail |
---|
public java.lang.String get(java.lang.String key)
null
if the specified field is not present.
When getting a multi-valued field, use the getArray(String)
or
getArray(String, String)
method instead.
key
- The field name.
public java.lang.String[] getArray(java.lang.String key)
getArray(String, String)
is
unsafe for ResultsReader
implementations that require a
delimiter. Therefore, this method should only be used for results that
are returned by ResultsReaderXml
. For other readers, use the
getArray(String, String)
method instead.
ResultsReader
object has no delimiter, the
original array of values is returned. If the object does have a
delimiter, the single/delimited value is assumed to be a single value and
is returned as a single-valued array.
key
- The field name.
public java.lang.String[] getArray(java.lang.String key, java.lang.String delimiter)
Event
object.
The delimiter is ignored for ResultsReader
implementations
that do not require a delimiter, such as ResultsReaderXml
.
If the underlying ResultsReader
object has no delimiter, the
original array of values is returned (and the specified delimiter is
ignored). If the object does have a delimiter, the
single/delimited value is split based on the specified delimiter and is
returned as an array.
key
- The field name.delimiter
- The delimiter.
public java.lang.String getSegmentedRaw()
"_raw"
field value. This value
is only used by the ResultsReaderXml
class.
The return value is different than that of get("_raw")
in that this segmented raw value is an XML fragment that includes all
markup such as XML tags and escaped characters.
For example, get("_raw")
returns this:
"http://localhost:8000/en-US/app/search/flashtimeline?q=search%20search%20index%3D_internal%20%7C%20head%2010&earliest=rt-1h&latest=rt"
The getSegmentedRaw
method returns this:
<v xml:space="preserve" trunc="0">"http://localhost:8000/en-US/app/<sg h=\"1\">search</sg>/flashtimeline?q=<sg h=\"1\">search</sg>%20<sg h=\"1\">search</sg>%20index%3D_internal%20%7C%20head%2010&earliest=rt-1h&latest=rt"</v>
public void clear()
clear
in interface java.util.Map<java.lang.String,java.lang.String>
clear
in class java.util.HashMap<java.lang.String,java.lang.String>
public java.lang.Object clone()
clone
in class java.util.HashMap<java.lang.String,java.lang.String>
public java.lang.String put(java.lang.String key, java.lang.String value)
put
in interface java.util.Map<java.lang.String,java.lang.String>
put
in class java.util.HashMap<java.lang.String,java.lang.String>
public void putAll(java.util.Map<? extends java.lang.String,? extends java.lang.String> m)
putAll
in interface java.util.Map<java.lang.String,java.lang.String>
putAll
in class java.util.HashMap<java.lang.String,java.lang.String>
public java.lang.String remove(java.lang.Object key)
remove
in interface java.util.Map<java.lang.String,java.lang.String>
remove
in class java.util.HashMap<java.lang.String,java.lang.String>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |