Package org.apache.beam.sdk.io.splunk
Class SplunkIO
java.lang.Object
org.apache.beam.sdk.io.splunk.SplunkIO
An unbounded sink for Splunk's Http Event Collector (HEC).
For more information, see the online documentation at Splunk HEC.
Writing to Splunk's 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:
- url - HEC endpoint URL.
- token - HEC endpoint token.
The SplunkIO
transform can be customized further by optionally specifying:
- parallelism - Number of parallel requests to the HEC.
- batchCount - Number of events in a single batch.
- disableCertificateValidation - Whether to disable ssl validation (useful for self-signed certificates)
- enableBatchLogs - Whether to enable batch logs.
- enableGzipHttpCompression - Whether HTTP requests sent to Splunk HEC should be GZIP encoded.
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));
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
ClassSplunkIO.Write
provides aPTransform
that allows writingSplunkEvent
records into a Splunk HTTP Event Collector end-point using HTTP POST requests. -
Method Summary
Modifier and TypeMethodDescriptionstatic SplunkIO.Write
Write to Splunk's Http Event Collector (HEC).static SplunkIO.Write
write
(ValueProvider<String> url, ValueProvider<String> token) Same aswrite(String, String)
but withValueProvider
.
-
Method Details
-
write
Write to Splunk's Http Event Collector (HEC).- Parameters:
url
- splunk hec urltoken
- splunk hec authentication token
-
write
Same aswrite(String, String)
but withValueProvider
.- Parameters:
url
- splunk hec urltoken
- splunk hec authentication token
-