public class SplunkIO
extends java.lang.Object
For more information, see the online documentation at Splunk HEC.
The SplunkIO
class provides a PTransform
that allows writing SplunkEvent
messages into a Splunk HEC end point.
It takes as an input a PCollection<SplunkEvent>
, where each SplunkEvent
represents an event to be published to HEC.
To configure a SplunkIO
, you must provide at a minimum:
The SplunkIO
transform can be customized further by optionally specifying:
This transform will return any non-transient write failures via a PCollection<SplunkWriteError>
, where each SplunkWriteError
captures the error that
occurred while attempting to write to HEC. These can be published to a dead-letter sink or
reprocessed.
For example:
PCollection<SplunkEvent> events = ...;
PCollection<SplunkWriteError> errors =
events.apply("WriteToSplunk",
SplunkIO.write(url, token)
.withBatchCount(batchCount)
.withParallelism(parallelism)
.withDisableCertificateValidation(true));
Modifier and Type | Class and Description |
---|---|
static class |
SplunkIO.Write
Class
SplunkIO.Write provides a PTransform that allows writing SplunkEvent
records into a Splunk HTTP Event Collector end-point using HTTP POST requests. |
Modifier and Type | Method and Description |
---|---|
static SplunkIO.Write |
write(java.lang.String url,
java.lang.String token)
Write to Splunk's Http Event Collector (HEC).
|
static SplunkIO.Write |
write(ValueProvider<java.lang.String> url,
ValueProvider<java.lang.String> token)
Same as
write(String, String) but with ValueProvider . |
public static SplunkIO.Write write(java.lang.String url, java.lang.String token)
url
- splunk hec urltoken
- splunk hec authentication tokenpublic static SplunkIO.Write write(ValueProvider<java.lang.String> url, ValueProvider<java.lang.String> token)
write(String, String)
but with ValueProvider
.url
- splunk hec urltoken
- splunk hec authentication token