Skip to main content

Splunk Source Node

The splunkSource node in ZephFlow enables you to ingest data from Splunk Enterprise or Splunk Cloud Platform by executing SPL search queries against the Splunk REST API.

Overview

The Splunk source node connects to a Splunk instance via its management port, submits a search job using SPL (Search Processing Language), waits for the job to complete, and emits the resulting records into your ZephFlow pipeline. This is a batch source — it runs the query once per pipeline execution.

Key Features

  • SPL Query Support: Execute any valid SPL search query against your Splunk instance
  • Credential Management: Authenticate with username/password credentials
  • SSL Configuration: Optional SSL certificate validation for HTTPS connections

Parameters

ParameterTypeDescriptionRequired
splunkUrlStringFull URL of the Splunk management endpoint (e.g., https://host:8089)Yes
searchQueryStringSPL query to execute (e.g., search index=main sourcetype=syslog)Yes
validateCertificatesbooleanWhether to validate SSL certificates for HTTPS connectionsNo
credentialIdStringID of a UsernamePasswordCredential in jobContext.otherPropertiesYes

Config Object

The full config object for the Splunk source node (SplunkSourceDto.Config):

FieldTypeRequiredDefaultDescription
splunkUrlStringYesFull URL of the Splunk management endpoint (e.g., https://host:8089)
searchQueryStringYesSPL query to execute
credentialIdStringYesCredential ID for Splunk authentication
validateCertificatesbooleanNofalseWhether to validate SSL certificates for HTTPS connections
batchSizeintNo10000Number of results to fetch per batch
jobInitTimeoutMslongNo300000Timeout in milliseconds for search job initialization
earliestTimeStringNonullEarliest time bound for the search (Splunk time format)
latestTimeStringNonullLatest time bound for the search (Splunk time format)

Java SDK Usage

The Splunk source has no dedicated builder method; attach it with appendNode("splunksource", config). The credential is registered in the JobContext under a credentialId.

Basic Usage

JobContext jobContext = JobContext.builder()
.otherProperties(new HashMap<>(Map.of(
"splunk-cred",
new UsernamePasswordCredential("splunk-username", "splunk-password"))))
.build();

ZephFlow flow = ZephFlow.startFlow(jobContext)
.appendNode("splunksource", SplunkSourceDto.Config.builder()
.splunkUrl("https://splunk.example.com:8089")
.searchQuery("search index=main sourcetype=access_log | head 100")
.validateCertificates(false)
.credentialId("splunk-cred")
.build());

Log Ingestion Pipeline

JobContext jobContext = JobContext.builder()
.otherProperties(new HashMap<>(Map.of(
"splunk-cred",
new UsernamePasswordCredential("splunk-user", "splunk-pass"))))
.build();

ZephFlow flow = ZephFlow.startFlow(jobContext)
.appendNode("splunksource", SplunkSourceDto.Config.builder()
.splunkUrl("https://splunk.example.com:8089")
.searchQuery("search index=main sourcetype=access_log | head 1000")
.validateCertificates(false)
.credentialId("splunk-cred")
.build())
.eval("dict_merge($, dict(ingested=true))")
.kafkaSink("kafka:9092", "splunk-records", null, EncodingType.JSON_OBJECT, null);

With SSL Validation

ZephFlow flow = ZephFlow.startFlow(jobContext)
.appendNode("splunksource", SplunkSourceDto.Config.builder()
.splunkUrl("https://splunk-prod.internal:8089")
.searchQuery("search index=security sourcetype=firewall action=blocked")
.validateCertificates(true)
.credentialId("splunk-cred")
.build())
.filter("$.severity == \"high\"")
.s3Sink("us-east-1", "security-logs", "blocked-records", EncodingType.JSON_OBJECT_LINE);