Package org.apache.beam.sdk.io.splunk
Class SplunkIO
- java.lang.Object
-
- org.apache.beam.sdk.io.splunk.SplunkIO
-
public class SplunkIO extends java.lang.ObjectAn 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
SplunkIOclass provides aPTransformthat allows writingSplunkEventmessages into a Splunk HEC end point.It takes as an input a
PCollection<SplunkEvent>, where eachSplunkEventrepresents 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
SplunkIOtransform 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 eachSplunkWriteErrorcaptures 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 Classes Modifier and Type Class Description static classSplunkIO.WriteClassSplunkIO.Writeprovides aPTransformthat allows writingSplunkEventrecords into a Splunk HTTP Event Collector end-point using HTTP POST requests.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static SplunkIO.Writewrite(java.lang.String url, java.lang.String token)Write to Splunk's Http Event Collector (HEC).static SplunkIO.Writewrite(org.apache.beam.sdk.options.ValueProvider<java.lang.String> url, org.apache.beam.sdk.options.ValueProvider<java.lang.String> token)Same aswrite(String, String)but withValueProvider.
-
-
-
Method Detail
-
write
public static SplunkIO.Write write(java.lang.String url, java.lang.String token)
Write to Splunk's Http Event Collector (HEC).- Parameters:
url- splunk hec urltoken- splunk hec authentication token
-
write
public static SplunkIO.Write write(org.apache.beam.sdk.options.ValueProvider<java.lang.String> url, org.apache.beam.sdk.options.ValueProvider<java.lang.String> token)
Same aswrite(String, String)but withValueProvider.- Parameters:
url- splunk hec urltoken- splunk hec authentication token
-
-