You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by gi...@apache.org on 2026/09/16 06:15:36 UTC

(seatunnel) branch gh-readonly-queue/dev/pr-12281-1325a44b2f4013198fdb2c12f9df345de1cde4bc created (now b37af3a9bf)

This is an automated email from the ASF dual-hosted git repository.

github-merge-queue[bot] pushed a change to branch gh-readonly-queue/dev/pr-12281-1325a44b2f4013198fdb2c12f9df345de1cde4bc
in repository https://gitbox.apache.org/repos/asf/seatunnel.git


      at b37af3a9bf [Feature] [connector-http] Add Splunk Source Connector and Unit Tests (#12281)

This branch includes the following new commits:

     new b37af3a9bf [Feature] [connector-http] Add Splunk Source Connector and Unit Tests (#12281)

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(seatunnel) 01/01: [Feature] [connector-http] Add Splunk Source Connector and Unit Tests (#12281)

Posted by gi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

github-merge-queue[bot] pushed a commit to branch gh-readonly-queue/dev/pr-12281-1325a44b2f4013198fdb2c12f9df345de1cde4bc
in repository https://gitbox.apache.org/repos/asf/seatunnel.git

commit b37af3a9bf634735cabe4908014c2d390b288558
Author: Saloni Gupta <sg...@gmail.com>
AuthorDate: Wed Sep 16 06:15:11 2026 +0000

    [Feature] [connector-http] Add Splunk Source Connector and Unit Tests (#12281)
---
 config/plugin_config                               |   1 +
 .../connectors/changelog/connector-http-splunk.md  |   3 +
 docs/en/connectors/source/Splunk.md                |  54 ++++++++
 plugin-mapping.properties                          |   1 +
 .../{ => connector-http-splunk}/pom.xml            |  42 +++---
 .../connectors/seatunnel/splunk/SplunkSource.java  |  55 ++++++++
 .../seatunnel/splunk/SplunkSourceFactory.java      |  54 ++++++++
 .../seatunnel/splunk/SplunkSourceReader.java       | 118 +++++++++++++++++
 .../splunk/config/SplunkSourceOptions.java         |  41 ++++++
 .../splunk/config/SplunkSourceParameter.java       |  68 ++++++++++
 .../seatunnel/splunk/SplunkSourceFactoryTest.java  | 142 +++++++++++++++++++++
 .../seatunnel/splunk/SplunkSourceReaderTest.java   |  76 +++++++++++
 seatunnel-connectors-v2/connector-http/pom.xml     |   1 +
 seatunnel-dist/pom.xml                             |   6 +
 14 files changed, 636 insertions(+), 26 deletions(-)

diff --git a/config/plugin_config b/config/plugin_config
index a278e647f0..651cb4033b 100644
--- a/config/plugin_config
+++ b/config/plugin_config
@@ -82,6 +82,7 @@ connector-http-notion
 connector-http-onesignal
 connector-http-persistiq
 connector-http-shopify
+connector-http-splunk
 connector-http-wechat
 connector-http-airtable
 connector-http-zendesk
diff --git a/docs/en/connectors/changelog/connector-http-splunk.md b/docs/en/connectors/changelog/connector-http-splunk.md
new file mode 100644
index 0000000000..c2e6a88eea
--- /dev/null
+++ b/docs/en/connectors/changelog/connector-http-splunk.md
@@ -0,0 +1,3 @@
+| Change | Commit | Version |
+| --- | --- | --- |
+| [Feature][connector-http-splunk] Add Splunk source connector | https://github.com/apache/seatunnel | dev |
\ No newline at end of file
diff --git a/docs/en/connectors/source/Splunk.md b/docs/en/connectors/source/Splunk.md
new file mode 100644
index 0000000000..2f5d5a9bb6
--- /dev/null
+++ b/docs/en/connectors/source/Splunk.md
@@ -0,0 +1,54 @@
+import ChangeLog from '../changelog/connector-http-splunk.md';
+
+# Http-Splunk Source Connector
+
+## Description
+
+The `Http-Splunk` connector allows batch reading data from Splunk REST API endpoints using an HTTP source pattern. It utilizes token-based authentication and supports synchronous search export endpoints via POST requests.
+
+## Key Features
+
+* HTTP-based ingestion from Splunk REST API (`/services/search/v2/jobs/export`)
+* Token-based authentication via the `Authorization` header
+* Form-urlencoded parameter mapping for search queries and output formats
+* Fail-safe memory guard (`max_response_size_bytes`) to protect worker heap on large exports
+
+## Options
+
+| Name | Type | Required | Default | Description |
+| --- | --- | --- | --- | --- |
+| url | String | Yes | - | Splunk REST API search export URL (`/services/search/v2/jobs/export`) |
+| api_key | String | Yes | - | Splunk authentication token (e.g., `Splunk <token>`) |
+| method | String | No | `POST` | HTTP request method |
+| keep_params_as_form | Boolean | No | `true` | Keep parameters as form urlencoded |
+| max_response_size_bytes | Long | No | `20971520` | Maximum allowed HTTP response size in bytes before failing fast, to avoid unbounded memory use on large exports. |
+| params | Map | Yes | - | Request parameters including `search` and `output_mode` |
+
+## Example Configuration
+
+```hocon
+source {
+  Splunk {
+    url = "https://your-splunk-instance:8089/services/search/v2/jobs/export"
+    api_key = "Splunk your_splunk_auth_token"
+    method = "POST"
+    keep_params_as_form = true
+    max_response_size_bytes = 20971520
+    params {
+      search = "search index=_internal | head 10"
+      output_mode = "json"
+    }
+    plugin_output = "splunk_data"
+  }
+}
+```
+
+## Large Exports & Memory Considerations
+
+Splunk's export endpoint can return arbitrarily large result sets. Because this connector buffers the full response in memory and parses it via intermediate string representations, peak memory usage during an export is a multiple (roughly 2x–3x) of the raw response size. 
+
+* **Default Limit:** The `max_response_size_bytes` option defaults to **20MB** (`20971520` bytes). 
+* **Worker Heap Sizing:** Operators should ensure that worker container/JVM heaps are budgeted appropriately relative to this limit. If your searches return high volumes of data, narrow your search window using Splunk's `earliest`/`latest` parameters or a smaller `head` limit. 
+* **Tuning:** Adjust `max_response_size_bytes` only after confirming your cluster worker has sufficient heap headroom to safely handle the memory multiplication factor of larger exports.
+
+<ChangeLog />
\ No newline at end of file
diff --git a/plugin-mapping.properties b/plugin-mapping.properties
index 641900fbe1..f77a63baf4 100644
--- a/plugin-mapping.properties
+++ b/plugin-mapping.properties
@@ -199,6 +199,7 @@ seatunnel.sink.Lance = connector-lance
 seatunnel.sink.BigQuery = connector-bigquery
 seatunnel.sink.NatsJetStream = connector-nats-jetstream
 seatunnel.source.Linear = connector-http-linear
+seatunnel.source.Splunk = connector-http-splunk
 
 # For custom transforms, make sure to use the seatunnel.transform.[PluginIdentifier]=[JarPerfix] naming convention. For example:
 # seatunnel.transform.Sql = seatunnel-transforms-v2
diff --git a/seatunnel-connectors-v2/connector-http/pom.xml b/seatunnel-connectors-v2/connector-http/connector-http-splunk/pom.xml
similarity index 51%
copy from seatunnel-connectors-v2/connector-http/pom.xml
copy to seatunnel-connectors-v2/connector-http/connector-http-splunk/pom.xml
index 4d33447da9..70ec614520 100644
--- a/seatunnel-connectors-v2/connector-http/pom.xml
+++ b/seatunnel-connectors-v2/connector-http/connector-http-splunk/pom.xml
@@ -22,34 +22,24 @@
     <modelVersion>4.0.0</modelVersion>
     <parent>
         <groupId>org.apache.seatunnel</groupId>
-        <artifactId>seatunnel-connectors-v2</artifactId>
+        <artifactId>connector-http</artifactId>
         <version>${revision}</version>
     </parent>
-    <artifactId>connector-http</artifactId>
-    <packaging>pom</packaging>
-    <name>SeaTunnel : Connectors V2 : Http :</name>
 
-    <modules>
-        <module>connector-http-base</module>
-        <module>connector-http-feishu</module>
-        <module>connector-http-wechat</module>
-        <module>connector-http-myhours</module>
-        <module>connector-http-lemlist</module>
-        <module>connector-http-klaviyo</module>
-        <module>connector-http-onesignal</module>
-        <module>connector-http-jira</module>
-        <module>connector-http-gitlab</module>
-        <module>connector-http-github</module>
-        <module>connector-http-notion</module>
-        <module>connector-http-persistiq</module>
-        <module>connector-http-airtable</module>
-        <module>connector-http-posthog</module>
-        <module>connector-http-shopify</module>
-        <module>connector-http-zendesk</module>
-        <module>connector-http-stripe</module>
-        <module>connector-http-paypal</module>
-        <module>connector-http-linear</module>
-        <module>connector-mem0</module>
-    </modules>
+    <artifactId>connector-http-splunk</artifactId>
+    <name>SeaTunnel : Connectors V2 : Http : Splunk</name>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.seatunnel</groupId>
+            <artifactId>connector-http-base</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.squareup.okhttp3</groupId>
+            <artifactId>mockwebserver</artifactId>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
 
 </project>
diff --git a/seatunnel-connectors-v2/connector-http/connector-http-splunk/src/main/java/org/apache/seatunnel/connectors/seatunnel/splunk/SplunkSource.java b/seatunnel-connectors-v2/connector-http/connector-http-splunk/src/main/java/org/apache/seatunnel/connectors/seatunnel/splunk/SplunkSource.java
new file mode 100644
index 0000000000..e502c01497
--- /dev/null
+++ b/seatunnel-connectors-v2/connector-http/connector-http-splunk/src/main/java/org/apache/seatunnel/connectors/seatunnel/splunk/SplunkSource.java
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.seatunnel.connectors.seatunnel.splunk;
+
+import org.apache.seatunnel.api.configuration.ReadonlyConfig;
+import org.apache.seatunnel.api.table.type.SeaTunnelRow;
+import org.apache.seatunnel.connectors.seatunnel.common.source.AbstractSingleSplitReader;
+import org.apache.seatunnel.connectors.seatunnel.common.source.SingleSplitReaderContext;
+import org.apache.seatunnel.connectors.seatunnel.http.source.HttpSource;
+import org.apache.seatunnel.connectors.seatunnel.splunk.config.SplunkSourceOptions;
+import org.apache.seatunnel.connectors.seatunnel.splunk.config.SplunkSourceParameter;
+
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
+public class SplunkSource extends HttpSource {
+    private final SplunkSourceParameter splunkSourceParameter = new SplunkSourceParameter();
+
+    public SplunkSource(ReadonlyConfig pluginConfig) {
+        super(pluginConfig);
+        String apiKey = pluginConfig.get(SplunkSourceOptions.API_KEY);
+        splunkSourceParameter.buildWithConfig(pluginConfig, apiKey);
+    }
+
+    @Override
+    public String getPluginName() {
+        return "splunk";
+    }
+
+    @Override
+    public AbstractSingleSplitReader<SeaTunnelRow> createReader(
+            SingleSplitReaderContext readerContext) throws Exception {
+        return new SplunkSourceReader(
+                this.splunkSourceParameter,
+                readerContext,
+                this.deserializationSchema,
+                jsonField,
+                contentField);
+    }
+}
diff --git a/seatunnel-connectors-v2/connector-http/connector-http-splunk/src/main/java/org/apache/seatunnel/connectors/seatunnel/splunk/SplunkSourceFactory.java b/seatunnel-connectors-v2/connector-http/connector-http-splunk/src/main/java/org/apache/seatunnel/connectors/seatunnel/splunk/SplunkSourceFactory.java
new file mode 100644
index 0000000000..dae63be393
--- /dev/null
+++ b/seatunnel-connectors-v2/connector-http/connector-http-splunk/src/main/java/org/apache/seatunnel/connectors/seatunnel/splunk/SplunkSourceFactory.java
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.seatunnel.connectors.seatunnel.splunk;
+
+import org.apache.seatunnel.api.configuration.util.OptionRule;
+import org.apache.seatunnel.api.source.SeaTunnelSource;
+import org.apache.seatunnel.api.source.SourceSplit;
+import org.apache.seatunnel.api.table.connector.TableSource;
+import org.apache.seatunnel.api.table.factory.Factory;
+import org.apache.seatunnel.api.table.factory.TableSourceFactoryContext;
+import org.apache.seatunnel.connectors.seatunnel.http.source.HttpSourceFactory;
+import org.apache.seatunnel.connectors.seatunnel.splunk.config.SplunkSourceOptions;
+
+import com.google.auto.service.AutoService;
+
+import java.io.Serializable;
+
+@AutoService(Factory.class)
+public class SplunkSourceFactory extends HttpSourceFactory {
+    @Override
+    public String factoryIdentifier() {
+        return "Splunk";
+    }
+
+    @Override
+    public <T, SplitT extends SourceSplit, StateT extends Serializable>
+            TableSource<T, SplitT, StateT> createSource(TableSourceFactoryContext context) {
+        return () -> (SeaTunnelSource<T, SplitT, StateT>) new SplunkSource(context.getOptions());
+    }
+
+    @Override
+    public OptionRule optionRule() {
+        return getHttpBuilder()
+                .required(SplunkSourceOptions.API_KEY)
+                .optional(SplunkSourceOptions.KEEP_PARAMS_AS_FORM)
+                .optional(SplunkSourceOptions.MAX_RESPONSE_SIZE_BYTES)
+                .build();
+    }
+}
diff --git a/seatunnel-connectors-v2/connector-http/connector-http-splunk/src/main/java/org/apache/seatunnel/connectors/seatunnel/splunk/SplunkSourceReader.java b/seatunnel-connectors-v2/connector-http/connector-http-splunk/src/main/java/org/apache/seatunnel/connectors/seatunnel/splunk/SplunkSourceReader.java
new file mode 100644
index 0000000000..a650298b63
--- /dev/null
+++ b/seatunnel-connectors-v2/connector-http/connector-http-splunk/src/main/java/org/apache/seatunnel/connectors/seatunnel/splunk/SplunkSourceReader.java
@@ -0,0 +1,118 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.seatunnel.connectors.seatunnel.splunk;
+
+import org.apache.seatunnel.shade.com.fasterxml.jackson.databind.JsonNode;
+import org.apache.seatunnel.shade.com.fasterxml.jackson.databind.ObjectMapper;
+
+import org.apache.seatunnel.api.serialization.DeserializationSchema;
+import org.apache.seatunnel.api.table.type.SeaTunnelRow;
+import org.apache.seatunnel.connectors.seatunnel.common.source.SingleSplitReaderContext;
+import org.apache.seatunnel.connectors.seatunnel.http.client.HttpResponse;
+import org.apache.seatunnel.connectors.seatunnel.http.config.HttpParameter;
+import org.apache.seatunnel.connectors.seatunnel.http.config.JsonField;
+import org.apache.seatunnel.connectors.seatunnel.http.exception.HttpConnectorErrorCode;
+import org.apache.seatunnel.connectors.seatunnel.http.exception.HttpConnectorException;
+import org.apache.seatunnel.connectors.seatunnel.http.source.HttpSourceReader;
+import org.apache.seatunnel.connectors.seatunnel.splunk.config.SplunkSourceParameter;
+
+import lombok.extern.slf4j.Slf4j;
+
+import java.nio.charset.StandardCharsets;
+
+@Slf4j
+public class SplunkSourceReader extends HttpSourceReader {
+
+    private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
+
+    public SplunkSourceReader(
+            HttpParameter httpParameter,
+            SingleSplitReaderContext readerContext,
+            DeserializationSchema<SeaTunnelRow> deserializationSchema,
+            JsonField jsonField,
+            String contentField) {
+        super(httpParameter, readerContext, deserializationSchema, jsonField, contentField);
+    }
+
+    @Override
+    protected HttpResponse executeRequest() throws Exception {
+        HttpResponse response = super.executeRequest();
+        String content = response.getContent();
+
+        if (content != null) {
+            long maxBytes = ((SplunkSourceParameter) httpParameter).getMaxResponseSizeBytes();
+            long contentSizeBytes = content.getBytes(StandardCharsets.UTF_8).length;
+
+            if (contentSizeBytes > maxBytes) {
+                throw new HttpConnectorException(
+                        HttpConnectorErrorCode.REQUEST_FAILED,
+                        String.format(
+                                "Splunk export response size (%d bytes) exceeds the configured "
+                                        + "max_response_size_bytes limit (%d bytes). Narrow the "
+                                        + "search's time window or result count (e.g. Splunk's "
+                                        + "earliest/latest parameters or a smaller 'head' limit), "
+                                        + "or raise max_response_size_bytes if you have confirmed "
+                                        + "sufficient worker heap for the larger export.",
+                                contentSizeBytes, maxBytes));
+            }
+
+            if (contentSizeBytes > maxBytes / 2) {
+                log.warn(
+                        "Splunk export response size ({} bytes) is more than half of the "
+                                + "configured max_response_size_bytes limit ({} bytes); consider "
+                                + "narrowing the search or reviewing worker heap sizing.",
+                        contentSizeBytes,
+                        maxBytes);
+            }
+        }
+
+        String filtered = filterAndUnwrapNdjson(response.getContent());
+        return new HttpResponse(response.getCode(), filtered);
+    }
+
+    /**
+     * Package-private and static so it can be unit tested directly, without mocking the HTTP
+     * client. Drops Splunk "preview" rows and unwraps each remaining line's "result" object so the
+     * parent reader's per-line deserialization sees plain row JSON.
+     */
+    static String filterAndUnwrapNdjson(String content) throws Exception {
+        if (content == null || content.isEmpty()) {
+            return content;
+        }
+        StringBuilder filtered = new StringBuilder();
+        for (String line : content.split("\r?\n")) {
+            if (line.trim().isEmpty()) {
+                continue;
+            }
+            JsonNode jsonNode = OBJECT_MAPPER.readTree(line);
+
+            JsonNode previewNode = jsonNode.get("preview");
+            if (previewNode != null && previewNode.asBoolean(false)) {
+                continue;
+            }
+
+            JsonNode resultNode = jsonNode.get("result");
+            if (resultNode == null || resultNode.isNull()) {
+                continue;
+            }
+
+            filtered.append(resultNode.toString()).append('\n');
+        }
+        return filtered.toString();
+    }
+}
diff --git a/seatunnel-connectors-v2/connector-http/connector-http-splunk/src/main/java/org/apache/seatunnel/connectors/seatunnel/splunk/config/SplunkSourceOptions.java b/seatunnel-connectors-v2/connector-http/connector-http-splunk/src/main/java/org/apache/seatunnel/connectors/seatunnel/splunk/config/SplunkSourceOptions.java
new file mode 100644
index 0000000000..8256a1f6a2
--- /dev/null
+++ b/seatunnel-connectors-v2/connector-http/connector-http-splunk/src/main/java/org/apache/seatunnel/connectors/seatunnel/splunk/config/SplunkSourceOptions.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.seatunnel.connectors.seatunnel.splunk.config;
+
+import org.apache.seatunnel.api.configuration.Option;
+import org.apache.seatunnel.api.configuration.Options;
+import org.apache.seatunnel.connectors.seatunnel.http.config.HttpCommonOptions;
+
+public class SplunkSourceOptions extends HttpCommonOptions {
+    public static final Option<String> API_KEY =
+            Options.key("api_key").stringType().noDefaultValue().withDescription("Splunk API Key");
+
+    public static final Option<Boolean> KEEP_PARAMS_AS_FORM =
+            Options.key("keep_params_as_form")
+                    .booleanType()
+                    .defaultValue(true)
+                    .withDescription("Keep params as form urlencoded");
+
+    public static final Option<Long> MAX_RESPONSE_SIZE_BYTES =
+            Options.key("max_response_size_bytes")
+                    .longType()
+                    .defaultValue(20L * 1024 * 1024) // 20MB
+                    .withDescription(
+                            "Maximum allowed HTTP response size in bytes before failing fast, to avoid unbounded in-memory buffering on large Splunk exports. "
+                                    + "Narrow the search's time window or result count if you hit this limit!");
+}
diff --git a/seatunnel-connectors-v2/connector-http/connector-http-splunk/src/main/java/org/apache/seatunnel/connectors/seatunnel/splunk/config/SplunkSourceParameter.java b/seatunnel-connectors-v2/connector-http/connector-http-splunk/src/main/java/org/apache/seatunnel/connectors/seatunnel/splunk/config/SplunkSourceParameter.java
new file mode 100644
index 0000000000..a438ac2359
--- /dev/null
+++ b/seatunnel-connectors-v2/connector-http/connector-http-splunk/src/main/java/org/apache/seatunnel/connectors/seatunnel/splunk/config/SplunkSourceParameter.java
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.seatunnel.connectors.seatunnel.splunk.config;
+
+import org.apache.seatunnel.api.configuration.ReadonlyConfig;
+import org.apache.seatunnel.connectors.seatunnel.http.config.HttpParameter;
+import org.apache.seatunnel.connectors.seatunnel.http.config.HttpRequestMethod;
+import org.apache.seatunnel.connectors.seatunnel.http.config.HttpSourceOptions;
+
+import java.util.HashMap;
+
+public class SplunkSourceParameter extends HttpParameter {
+
+    private long maxResponseSizeBytes;
+
+    public long getMaxResponseSizeBytes() {
+        return maxResponseSizeBytes;
+    }
+
+    /**
+     * Overrides buildWithConfig to accept an explicit apiKey parameter. Splunk's REST API requires
+     * the API key to be passed specifically as an Authorization header, so this method ensures the
+     * key is properly extracted and configured.
+     */
+    public void buildWithConfig(ReadonlyConfig pluginConfig, String apiKey) {
+        super.buildWithConfig(pluginConfig);
+
+        if (!pluginConfig.getOptional(HttpSourceOptions.METHOD).isPresent()) {
+            this.setMethod(HttpRequestMethod.POST);
+        }
+
+        if (this.headers == null) {
+            this.headers = new HashMap<>();
+        }
+        this.headers.put("Authorization", apiKey);
+
+        // HttpClientProvider.addBody(HttpPost, String) always wraps a non-empty `body` string in
+        // application/json, which breaks Splunk's export endpoint (it requires search/output_mode
+        // as URL-encoded form fields). Users must supply them via the `params` block, not `body`.
+        this.headers.put("Content-Type", "application/x-www-form-urlencoded");
+
+        if (this.params == null) {
+            this.params = new HashMap<>();
+        }
+        // Defensive default: this connector's response parser (SplunkSourceReader) only handles
+        // JSON. Don't override if the user explicitly set something else in `params`.
+        this.params.putIfAbsent("output_mode", "json");
+        this.setKeepParamsAsForm(pluginConfig.get(SplunkSourceOptions.KEEP_PARAMS_AS_FORM));
+
+        this.setEnableMultilines(true);
+        this.maxResponseSizeBytes = pluginConfig.get(SplunkSourceOptions.MAX_RESPONSE_SIZE_BYTES);
+    }
+}
diff --git a/seatunnel-connectors-v2/connector-http/connector-http-splunk/src/test/java/org/apache/seatunnel/connectors/seatunnel/splunk/SplunkSourceFactoryTest.java b/seatunnel-connectors-v2/connector-http/connector-http-splunk/src/test/java/org/apache/seatunnel/connectors/seatunnel/splunk/SplunkSourceFactoryTest.java
new file mode 100644
index 0000000000..3a6ef66747
--- /dev/null
+++ b/seatunnel-connectors-v2/connector-http/connector-http-splunk/src/test/java/org/apache/seatunnel/connectors/seatunnel/splunk/SplunkSourceFactoryTest.java
@@ -0,0 +1,142 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.seatunnel.connectors.seatunnel.splunk;
+
+import org.apache.seatunnel.api.configuration.ReadonlyConfig;
+import org.apache.seatunnel.connectors.seatunnel.http.client.HttpClientProvider;
+import org.apache.seatunnel.connectors.seatunnel.splunk.config.SplunkSourceParameter;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+import java.util.HashMap;
+
+public class SplunkSourceFactoryTest {
+
+    @Test
+    public void testFactoryIdentifier() {
+        SplunkSourceFactory factory = new SplunkSourceFactory();
+        Assertions.assertEquals("Splunk", factory.factoryIdentifier());
+    }
+
+    @Test
+    public void testHeadersInitializationWithoutExistingHeaders() {
+        ReadonlyConfig config = ReadonlyConfig.fromMap(new HashMap<>());
+        String apiKey = "test-splunk-api-key";
+
+        SplunkSourceParameter parameter = new SplunkSourceParameter();
+        parameter.buildWithConfig(config, apiKey);
+
+        Assertions.assertNotNull(parameter.getHeaders());
+        Assertions.assertEquals(apiKey, parameter.getHeaders().get("Authorization"));
+    }
+
+    @Test
+    public void testHeadersAndFormSemanticsInitialization() {
+        ReadonlyConfig config = ReadonlyConfig.fromMap(new HashMap<>());
+        String apiKey = "Splunk test-splunk-api-key";
+
+        SplunkSourceParameter parameter = new SplunkSourceParameter();
+        parameter.buildWithConfig(config, apiKey);
+
+        Assertions.assertNotNull(parameter.getHeaders());
+        Assertions.assertEquals(apiKey, parameter.getHeaders().get("Authorization"));
+        Assertions.assertEquals(
+                "application/x-www-form-urlencoded", parameter.getHeaders().get("Content-Type"));
+        Assertions.assertTrue(parameter.isKeepParamsAsForm());
+    }
+
+    @Test
+    public void testV2EndpointConfiguration() {
+        HashMap<String, Object> configMap = new HashMap<>();
+        configMap.put("url", "https://your-splunk-instance:8089/services/search/v2/jobs/export");
+        ReadonlyConfig config = ReadonlyConfig.fromMap(configMap);
+
+        SplunkSourceParameter parameter = new SplunkSourceParameter();
+        parameter.buildWithConfig(config, "Splunk test-key");
+
+        Assertions.assertEquals(
+                "https://your-splunk-instance:8089/services/search/v2/jobs/export",
+                parameter.getUrl());
+    }
+
+    @Test
+    public void testParamsDefaultOutputModeAndFormEncoding() {
+        HashMap<String, Object> configMap = new HashMap<>();
+        HashMap<String, Object> params = new HashMap<>();
+        params.put("search", "search index=_internal | head 10");
+        configMap.put("params", params);
+        ReadonlyConfig config = ReadonlyConfig.fromMap(configMap);
+
+        SplunkSourceParameter parameter = new SplunkSourceParameter();
+        parameter.buildWithConfig(config, "Splunk test-key");
+
+        Assertions.assertEquals("json", parameter.getParams().get("output_mode"));
+        Assertions.assertEquals(
+                "search index=_internal | head 10", parameter.getParams().get("search"));
+        Assertions.assertTrue(parameter.isKeepParamsAsForm());
+    }
+
+    @Test
+    public void testHttpClientPayloadCapture() throws Exception {
+        try (okhttp3.mockwebserver.MockWebServer server =
+                new okhttp3.mockwebserver.MockWebServer()) {
+            server.enqueue(
+                    new okhttp3.mockwebserver.MockResponse()
+                            .setBody("{\"preview\": false, \"result\": {\"test\": \"data\"}}")
+                            .setResponseCode(200));
+            server.start();
+
+            String baseUrl = server.url("/services/search/v2/jobs/export").toString();
+
+            HashMap<String, Object> configMap = new HashMap<>();
+            configMap.put("url", baseUrl);
+            configMap.put("method", "POST");
+            HashMap<String, Object> params = new HashMap<>();
+            params.put("search", "search index=_internal | head 10");
+            configMap.put("params", params);
+
+            ReadonlyConfig config = ReadonlyConfig.fromMap(configMap);
+            SplunkSourceParameter parameter = new SplunkSourceParameter();
+            parameter.buildWithConfig(config, "Splunk test-auth-token");
+
+            try (HttpClientProvider client = new HttpClientProvider(parameter)) {
+                client.execute(
+                        parameter.getUrl(),
+                        parameter.getMethod().getMethod(),
+                        parameter.getHeaders(),
+                        parameter.getParams(),
+                        parameter.getBody(),
+                        parameter.isKeepParamsAsForm());
+            }
+
+            okhttp3.mockwebserver.RecordedRequest recordedRequest = server.takeRequest();
+
+            Assertions.assertEquals("POST", recordedRequest.getMethod());
+            Assertions.assertEquals(
+                    "application/x-www-form-urlencoded", recordedRequest.getHeader("Content-Type"));
+            Assertions.assertEquals(
+                    "Splunk test-auth-token", recordedRequest.getHeader("Authorization"));
+
+            String requestBody = recordedRequest.getBody().readUtf8();
+            String decodedBody = java.net.URLDecoder.decode(requestBody, "UTF-8");
+            Assertions.assertTrue(decodedBody.contains("search=search index=_internal | head 10"));
+            Assertions.assertTrue(decodedBody.contains("output_mode=json"));
+        }
+    }
+}
diff --git a/seatunnel-connectors-v2/connector-http/connector-http-splunk/src/test/java/org/apache/seatunnel/connectors/seatunnel/splunk/SplunkSourceReaderTest.java b/seatunnel-connectors-v2/connector-http/connector-http-splunk/src/test/java/org/apache/seatunnel/connectors/seatunnel/splunk/SplunkSourceReaderTest.java
new file mode 100644
index 0000000000..bd14e05b54
--- /dev/null
+++ b/seatunnel-connectors-v2/connector-http/connector-http-splunk/src/test/java/org/apache/seatunnel/connectors/seatunnel/splunk/SplunkSourceReaderTest.java
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.seatunnel.connectors.seatunnel.splunk;
+
+import org.apache.seatunnel.api.configuration.ReadonlyConfig;
+import org.apache.seatunnel.connectors.seatunnel.http.exception.HttpConnectorException;
+import org.apache.seatunnel.connectors.seatunnel.splunk.config.SplunkSourceParameter;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+import okhttp3.mockwebserver.MockResponse;
+import okhttp3.mockwebserver.MockWebServer;
+
+import java.util.HashMap;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+public class SplunkSourceReaderTest {
+
+    @Test
+    public void testExactlyTwoRowsWithPreviewDeduplication() throws Exception {
+        String ndjson =
+                "{\"preview\":true,\"offset\":0,\"result\":{\"a\":\"1\"}}\n"
+                        + "{\"preview\":false,\"offset\":0,\"result\":{\"a\":\"1\"}}\n"
+                        + "{\"preview\":false,\"offset\":1,\"result\":{\"a\":\"2\"}}";
+
+        String filtered = SplunkSourceReader.filterAndUnwrapNdjson(ndjson);
+        String[] rows = filtered.split("\n");
+
+        assertEquals(2, rows.length);
+        assertTrue(rows[0].contains("\"a\":\"1\""));
+        assertTrue(rows[1].contains("\"a\":\"2\""));
+    }
+
+    @Test
+    public void testFailsFastWhenResponseExceedsMaxSize() throws Exception {
+        try (MockWebServer server = new MockWebServer()) {
+            server.start();
+            server.enqueue(new MockResponse().setBody("exceeds-limit"));
+
+            HashMap<String, Object> configMap = new HashMap<>();
+            configMap.put("url", server.url("/").toString());
+            configMap.put("api_key", "Splunk test-key");
+            configMap.put("max_response_size_bytes", 5L); // tiny limit to trigger
+
+            ReadonlyConfig config = ReadonlyConfig.fromMap(configMap);
+            SplunkSourceParameter parameter = new SplunkSourceParameter();
+            parameter.buildWithConfig(config, "Splunk test-key");
+
+            SplunkSourceReader reader = new SplunkSourceReader(parameter, null, null, null, null);
+            reader.open();
+            try {
+                Assertions.assertThrows(HttpConnectorException.class, reader::executeRequest);
+            } finally {
+                reader.close();
+            }
+        }
+    }
+}
diff --git a/seatunnel-connectors-v2/connector-http/pom.xml b/seatunnel-connectors-v2/connector-http/pom.xml
index 4d33447da9..92286f0525 100644
--- a/seatunnel-connectors-v2/connector-http/pom.xml
+++ b/seatunnel-connectors-v2/connector-http/pom.xml
@@ -49,6 +49,7 @@
         <module>connector-http-stripe</module>
         <module>connector-http-paypal</module>
         <module>connector-http-linear</module>
+        <module>connector-http-splunk</module>
         <module>connector-mem0</module>
     </modules>
 
diff --git a/seatunnel-dist/pom.xml b/seatunnel-dist/pom.xml
index 089cf82cc9..cdbaf588cb 100644
--- a/seatunnel-dist/pom.xml
+++ b/seatunnel-dist/pom.xml
@@ -314,6 +314,12 @@
                     <version>${project.version}</version>
                     <scope>provided</scope>
                 </dependency>
+                <dependency>
+                    <groupId>org.apache.seatunnel</groupId>
+                    <artifactId>connector-http-splunk</artifactId>
+                    <version>${project.version}</version>
+                    <scope>provided</scope>
+                </dependency>
                 <dependency>
                     <groupId>org.apache.seatunnel</groupId>
                     <artifactId>connector-http-zendesk</artifactId>