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

acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git


The following commit(s) were added to refs/heads/main by this push:
     new 0a4ff8bf Add Splunk sources and sinks
0a4ff8bf is described below

commit 0a4ff8bf65fefff1a9f73d8ca42a59132205e81f
Author: Claudio Miranda <clau...@claudius.com.br>
AuthorDate: Wed Jun 29 13:39:15 2022 -0300

    Add Splunk sources and sinks
    
    * splunk and splunk-hec
---
 docs/modules/ROOT/nav.adoc                         |   3 +
 kamelets/splunk-hec-sink.kamelet.yaml              | 123 ++++++++++++++++
 kamelets/splunk-sink.kamelet.yaml                  | 122 ++++++++++++++++
 kamelets/splunk-source.kamelet.yaml                | 159 +++++++++++++++++++++
 .../kamelets/splunk-hec-sink.kamelet.yaml          | 123 ++++++++++++++++
 .../resources/kamelets/splunk-sink.kamelet.yaml    | 122 ++++++++++++++++
 .../resources/kamelets/splunk-source.kamelet.yaml  | 159 +++++++++++++++++++++
 .../bindings/camel-k/splunk-hec-sink-binding.yaml  |  19 +++
 .../bindings/camel-k/splunk-sink-binding.yaml      |  20 +++
 .../bindings/camel-k/splunk-source-binding.yaml    |  21 +++
 .../bindings/core/splunk-hec-sink-binding.yaml     |  15 ++
 templates/bindings/core/splunk-sink-binding.yaml   |  13 ++
 templates/bindings/core/splunk-source-binding.yaml |  12 ++
 13 files changed, 911 insertions(+)

diff --git a/docs/modules/ROOT/nav.adoc b/docs/modules/ROOT/nav.adoc
index 307c3488..bb6140f8 100644
--- a/docs/modules/ROOT/nav.adoc
+++ b/docs/modules/ROOT/nav.adoc
@@ -169,6 +169,9 @@
 * xref:slack-source.adoc[]
 * xref:solr-sink.adoc[]
 * xref:solr-source.adoc[]
+* xref:splunk-hec-sink.adoc[]
+* xref:splunk-sink.adoc[]
+* xref:splunk-source.adoc[]
 * xref:sqlserver-sink.adoc[]
 * xref:sqlserver-source.adoc[]
 * xref:ssh-sink.adoc[]
diff --git a/kamelets/splunk-hec-sink.kamelet.yaml 
b/kamelets/splunk-hec-sink.kamelet.yaml
new file mode 100644
index 00000000..72548791
--- /dev/null
+++ b/kamelets/splunk-hec-sink.kamelet.yaml
@@ -0,0 +1,123 @@
+# ---------------------------------------------------------------------------
+# 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.
+# ---------------------------------------------------------------------------
+apiVersion: camel.apache.org/v1alpha1
+kind: Kamelet
+metadata:
+  name: splunk-hec-sink
+  annotations:
+    camel.apache.org/kamelet.support.level: "Preview"
+    camel.apache.org/catalog.version: "main-SNAPSHOT"
+    camel.apache.org/kamelet.icon: 
"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHJvbGU9ImltZyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48dGl0bGU+U3BsdW5rIGljb248L3RpdGxlPjxwYXRoIGQ9Ik0yMy4zNDggMTEuOTExbC0yLjI0MS0xLjA5MXYtLjY1TDI0IDExLjYyMXYuNTkzbC0yLjg5MyAxLjQzOHYtLjYzNnptLTUuMzk3IDEuODQxaC0uOTYxdi01LjMxaC45NjF2My4xMTZoLjEwMmwxLjI4LTEuNDgxLjcyMy4zMS0xLjIzIDEuMzE2IDEuNDUzIDEuODA5LS44ODguMzExLTEuNDQtMS45OTZ6bS0yLjU3Ny0uMDAydi0yLjA2OG
 [...]
+    camel.apache.org/provider: "Apache Software Foundation"
+    camel.apache.org/kamelet.group: "SPLUNK"
+  labels:
+    camel.apache.org/kamelet.type: "sink"
+spec:
+  definition:
+    title: "Splunk HEC Sink"
+    description: |-
+      The Splunk HEC sink allows to send data to Splunk using the 
https://docs.splunk.com/Documentation/Splunk/latest/Data/UsetheHTTPEventCollector[HTTP
 Event Collector].
+
+    required:
+      - splunkUrl
+      - token
+    type: object
+    properties:
+      splunkUrl:
+        title: Splunk URL
+        description: The URL of your Splunk server. No need to set the 
protocol prefix.
+        type: string
+        example: my_server.splunkcloud.com:8088
+      token:
+        title: Token
+        description: The Token of the HEC. Note it is not the user's 
authentication token.
+        type: string
+        format: password
+        x-descriptors:
+        - urn:alm:descriptor:com.tectonic.ui:password
+        - urn:camel:group:credentials
+      hostPayload:
+        title: Host of the Event
+        description: The host field set in the data sent to Splunk, it is not 
related to the Splunk URL or the connection to Splunk server.
+        type: string
+      bodyOnly:
+        title: Body Only
+        description: Send to Splunk only data contained in the body.
+        type: boolean
+        x-descriptors:
+        - urn:alm:descriptor:com.tectonic.ui:checkbox
+        default: false
+      headersOnly:
+        title: Headers Only
+        description: Send to Splunk only data contained in the headers.
+        type: boolean
+        x-descriptors:
+        - urn:alm:descriptor:com.tectonic.ui:checkbox
+        default: false
+      index:
+        title: Index
+        description: Splunk index to write to.
+        type: string
+      source:
+        title: Source
+        description: The source named field of the data.
+        type: string
+      sourceType:
+        title: Source Type
+        description: The source named field of the data.
+        type: string
+      skipTlsVerify:
+        title: Skip TLS Verification
+        description: Skip TLS verification.
+        type: boolean
+        x-descriptors:
+        - urn:alm:descriptor:com.tectonic.ui:checkbox
+        default: false
+      https:
+        title: Secure
+        description: Use a secure HTTPS connection.
+        type: boolean
+        x-descriptors:
+        - urn:alm:descriptor:com.tectonic.ui:checkbox
+        default: true
+      time:
+        title: Time
+        description: Time this even occurred. By default, the time will be 
when this event hits the splunk server.
+        type: string
+  types:
+    in:
+      mediaType: application/json
+  dependencies:
+  - "camel:core"
+  - "camel:splunk-hec"
+  - "camel:kamelet"
+  template:
+    from:
+      uri: "kamelet:source"
+      steps:
+      - to:
+          uri: "splunk-hec:{{splunkUrl}}/{{token}}"
+          parameters:
+            host: "{{?hostPayload}}"
+            bodyOnly: "{{?bodyOnly}}"
+            headersOnly: "{{?headersOnly}}"
+            index: "{{?index}}"
+            source: "{{?source}}"
+            sourceType: "{{?sourceType}}"
+            skipTlsVerify: "{{?skipTlsVerify}}"
+            https: "{{?https}}"
+            time: "{{?time}}"
diff --git a/kamelets/splunk-sink.kamelet.yaml 
b/kamelets/splunk-sink.kamelet.yaml
new file mode 100644
index 00000000..993dea61
--- /dev/null
+++ b/kamelets/splunk-sink.kamelet.yaml
@@ -0,0 +1,122 @@
+# ---------------------------------------------------------------------------
+# 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.
+# ---------------------------------------------------------------------------
+apiVersion: camel.apache.org/v1alpha1
+kind: Kamelet
+metadata:
+  name: splunk-sink
+  annotations:
+    camel.apache.org/kamelet.support.level: "Preview"
+    camel.apache.org/catalog.version: "main-SNAPSHOT"
+    camel.apache.org/kamelet.icon: 
"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHJvbGU9ImltZyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48dGl0bGU+U3BsdW5rIGljb248L3RpdGxlPjxwYXRoIGQ9Ik0yMy4zNDggMTEuOTExbC0yLjI0MS0xLjA5MXYtLjY1TDI0IDExLjYyMXYuNTkzbC0yLjg5MyAxLjQzOHYtLjYzNnptLTUuMzk3IDEuODQxaC0uOTYxdi01LjMxaC45NjF2My4xMTZoLjEwMmwxLjI4LTEuNDgxLjcyMy4zMS0xLjIzIDEuMzE2IDEuNDUzIDEuODA5LS44ODguMzExLTEuNDQtMS45OTZ6bS0yLjU3Ny0uMDAydi0yLjA2OG
 [...]
+    camel.apache.org/provider: "Apache Software Foundation"
+    camel.apache.org/kamelet.group: "SPLUNK"
+  labels:
+    camel.apache.org/kamelet.type: "sink"
+spec:
+  definition:
+    title: "Splunk Sink"
+    description: |-
+      Send data to Splunk either by using "submit" or "stream" mode.
+
+      The payload MUST be in json format.
+
+    required:
+      - serverHostname
+      - username
+      - password
+    type: object
+    properties:
+      serverHostname:
+        title: Splunk Server Address
+        description: The address of your Splunk server.
+        type: string
+        example: my_server_splunk.com
+      serverPort:
+        title: Splunk Server Port
+        description: The address of your Splunk server.
+        type: integer
+        default: 8089
+      username:
+        title: Username
+        description: The username to authenticate to Splunk Server.
+        type: string
+      password:
+        title: Password
+        description: The password to authenticate to Splunk Server.
+        type: string
+        format: password
+        x-descriptors:
+        - urn:alm:descriptor:com.tectonic.ui:password
+        - urn:camel:group:credentials
+      index:
+        title: Index
+        description: Splunk index to write to.
+        type: string
+      protocol:
+        title: Protocol
+        description: Connection Protocol to Splunk server.
+        type: string
+        default: https
+        enum: ["http", "https"]
+      source:
+        title: Source
+        description: The source named field of the data.
+        type: string
+      sourceType:
+        title: Source Type
+        description: The source named field of the data.
+        type: string
+      app:
+        title: Splunk App
+        description: The app name in Splunk.
+        type: string
+      connectionTimeout:
+        title: Connection Timeout
+        description: Timeout in milliseconds when connecting to Splunk server
+        type: integer
+        default: 5000
+      mode:
+        title: Mode
+        description: The mode to publish events to Splunk.
+        type: string
+        default: stream
+        enum: ["submit", "stream"]
+  types:
+    in:
+      mediaType: application/json
+  dependencies:
+  - "camel:core"
+  - "camel:splunk"
+  - "camel:kamelet"
+  template:
+    from:
+      uri: "kamelet:source"
+      steps:
+      - to:
+          uri: "splunk:{{mode}}"
+          parameters:
+            host: "{{serverHostname}}"
+            port: "{{serverPort}}"
+            username: "{{username}}"
+            password: "{{password}}"
+            source: "{{?source}}"
+            sourceType: "{{?sourceType}}"
+            scheme: "{{?protocol}}"
+            index: "{{?index}}"
+            app: "{{?app}}"
+            connectionTimeout: "{{?connectionTimeout}}"
+            raw: true
diff --git a/kamelets/splunk-source.kamelet.yaml 
b/kamelets/splunk-source.kamelet.yaml
new file mode 100644
index 00000000..3440990b
--- /dev/null
+++ b/kamelets/splunk-source.kamelet.yaml
@@ -0,0 +1,159 @@
+# ---------------------------------------------------------------------------
+# 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.
+# ---------------------------------------------------------------------------
+apiVersion: camel.apache.org/v1alpha1
+kind: Kamelet
+metadata:
+  name: splunk-source
+  annotations:
+    camel.apache.org/kamelet.support.level: "Preview"
+    camel.apache.org/catalog.version: "main-SNAPSHOT"
+    camel.apache.org/kamelet.icon: 
"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHJvbGU9ImltZyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48dGl0bGU+U3BsdW5rIGljb248L3RpdGxlPjxwYXRoIGQ9Ik0yMy4zNDggMTEuOTExbC0yLjI0MS0xLjA5MXYtLjY1TDI0IDExLjYyMXYuNTkzbC0yLjg5MyAxLjQzOHYtLjYzNnptLTUuMzk3IDEuODQxaC0uOTYxdi01LjMxaC45NjF2My4xMTZoLjEwMmwxLjI4LTEuNDgxLjcyMy4zMS0xLjIzIDEuMzE2IDEuNDUzIDEuODA5LS44ODguMzExLTEuNDQtMS45OTZ6bS0yLjU3Ny0uMDAydi0yLjA2OG
 [...]
+    camel.apache.org/provider: "Apache Software Foundation"
+    camel.apache.org/kamelet.group: "SPLUNK"
+  labels:
+    camel.apache.org/kamelet.type: "source"
+spec:
+  definition:
+    title: "Splunk Source"
+    description: |-
+      Retrieve data from Splunk and outputs in json format.
+
+      For the fields accepting time specifiers like `earliestTime`, it accepts 
a wide variety of formats, please check 
https://docs.splunk.com/Documentation/Splunk/9.0.0/Search/Specifytimemodifiersinyoursearch[Splunk
 documentation] for more information.
+
+    required:
+      - serverHostname
+      - username
+      - password
+      - query
+    type: object
+    properties:
+      serverHostname:
+        title: Splunk Server Address
+        description: The address of your Splunk server.
+        type: string
+        example: my_server_splunk.com
+      serverPort:
+        title: Splunk Server Port
+        description: The address of your Splunk server.
+        type: integer
+        default: 8089
+      username:
+        title: Username
+        description: The username to authenticate to Splunk Server.
+        type: string
+      password:
+        title: Password
+        description: The password to authenticate to Splunk Server.
+        type: string
+        format: password
+        x-descriptors:
+        - urn:alm:descriptor:com.tectonic.ui:password
+        - urn:camel:group:credentials
+      index:
+        title: Index
+        description: Splunk index to write to.
+        type: string
+      protocol:
+        title: Protocol
+        description: Connection Protocol to Splunk server.
+        type: string
+        default: https
+        enum: ["http", "https"]
+      source:
+        title: Source
+        description: The source named field of the data.
+        type: string
+      sourceType:
+        title: Source Type
+        description: The source named field of the data.
+        type: string
+      app:
+        title: Splunk App
+        description: The app name in Splunk.
+        type: string
+      connectionTimeout:
+        title: Connection Timeout
+        description: Timeout in milliseconds when connecting to Splunk server
+        type: integer
+      count:
+        title: Count
+        description: The maximum number of entities to return.
+        type: integer
+      repeat:
+        title: Repeat
+        description: The maximum number of fires.
+        type: integer
+      delay:
+        title: Delay
+        description: Milliseconds before the next poll.
+        type: integer
+      query:
+        title: Query
+        description: The Splunk query to run.
+        type: string
+      earliestTime:
+        title: Earliest Time
+        description: Earliest time of the search time window.
+        type: string
+        example: "05/17/22 08:35:46:456"
+      initEarliestTime:
+        title: Init Earliest Time
+        description: Initial start offset of the first search.
+        type: string
+        example: "05/17/22 08:35:46:456"
+      latestTime:
+        title: Latest Time
+        description: Latest time of the search time window.
+        type: string
+        example: "05/17/22 08:35:46:456"
+  types:
+    out:
+      mediaType: application/json
+  dependencies:
+  - "camel:jackson"
+  - "camel:core"
+  - "camel:splunk"
+  - "camel:kamelet"
+  - "mvn:com.fasterxml.jackson.datatype:jackson-datatype-joda:2.12.5"
+  template:
+    from:
+      uri: "splunk:normal"
+      parameters:
+        host: "{{serverHostname}}"
+        port: "{{serverPort}}"
+        username: "{{username}}"
+        password: "{{password}}"
+        index: "{{?index}}"
+        scheme: "{{?protocol}}"
+        source: "{{?source}}"
+        sourceType: "{{?sourceType}}"
+        app: "{{?app}}"
+        connectionTimeout: "{{?connectionTimeout}}"
+        count: "{{?count}}"
+        repeatCount: "{{?repeat}}"
+        delay: "{{?delay}}"
+        search: "{{?query}}"
+        earliestTime: "{{?earliestTime}}"
+        initEarliestTime: "{{?initEarliestTime}}"
+        latestTime: "{{?latestTime}}"
+        raw: true
+      steps:
+      - marshal:
+          json:
+            library: Jackson
+            module-class-names: com.fasterxml.jackson.datatype.joda.JodaModule
+      - to: "kamelet:sink"
diff --git 
a/library/camel-kamelets/src/main/resources/kamelets/splunk-hec-sink.kamelet.yaml
 
b/library/camel-kamelets/src/main/resources/kamelets/splunk-hec-sink.kamelet.yaml
new file mode 100644
index 00000000..72548791
--- /dev/null
+++ 
b/library/camel-kamelets/src/main/resources/kamelets/splunk-hec-sink.kamelet.yaml
@@ -0,0 +1,123 @@
+# ---------------------------------------------------------------------------
+# 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.
+# ---------------------------------------------------------------------------
+apiVersion: camel.apache.org/v1alpha1
+kind: Kamelet
+metadata:
+  name: splunk-hec-sink
+  annotations:
+    camel.apache.org/kamelet.support.level: "Preview"
+    camel.apache.org/catalog.version: "main-SNAPSHOT"
+    camel.apache.org/kamelet.icon: 
"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHJvbGU9ImltZyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48dGl0bGU+U3BsdW5rIGljb248L3RpdGxlPjxwYXRoIGQ9Ik0yMy4zNDggMTEuOTExbC0yLjI0MS0xLjA5MXYtLjY1TDI0IDExLjYyMXYuNTkzbC0yLjg5MyAxLjQzOHYtLjYzNnptLTUuMzk3IDEuODQxaC0uOTYxdi01LjMxaC45NjF2My4xMTZoLjEwMmwxLjI4LTEuNDgxLjcyMy4zMS0xLjIzIDEuMzE2IDEuNDUzIDEuODA5LS44ODguMzExLTEuNDQtMS45OTZ6bS0yLjU3Ny0uMDAydi0yLjA2OG
 [...]
+    camel.apache.org/provider: "Apache Software Foundation"
+    camel.apache.org/kamelet.group: "SPLUNK"
+  labels:
+    camel.apache.org/kamelet.type: "sink"
+spec:
+  definition:
+    title: "Splunk HEC Sink"
+    description: |-
+      The Splunk HEC sink allows to send data to Splunk using the 
https://docs.splunk.com/Documentation/Splunk/latest/Data/UsetheHTTPEventCollector[HTTP
 Event Collector].
+
+    required:
+      - splunkUrl
+      - token
+    type: object
+    properties:
+      splunkUrl:
+        title: Splunk URL
+        description: The URL of your Splunk server. No need to set the 
protocol prefix.
+        type: string
+        example: my_server.splunkcloud.com:8088
+      token:
+        title: Token
+        description: The Token of the HEC. Note it is not the user's 
authentication token.
+        type: string
+        format: password
+        x-descriptors:
+        - urn:alm:descriptor:com.tectonic.ui:password
+        - urn:camel:group:credentials
+      hostPayload:
+        title: Host of the Event
+        description: The host field set in the data sent to Splunk, it is not 
related to the Splunk URL or the connection to Splunk server.
+        type: string
+      bodyOnly:
+        title: Body Only
+        description: Send to Splunk only data contained in the body.
+        type: boolean
+        x-descriptors:
+        - urn:alm:descriptor:com.tectonic.ui:checkbox
+        default: false
+      headersOnly:
+        title: Headers Only
+        description: Send to Splunk only data contained in the headers.
+        type: boolean
+        x-descriptors:
+        - urn:alm:descriptor:com.tectonic.ui:checkbox
+        default: false
+      index:
+        title: Index
+        description: Splunk index to write to.
+        type: string
+      source:
+        title: Source
+        description: The source named field of the data.
+        type: string
+      sourceType:
+        title: Source Type
+        description: The source named field of the data.
+        type: string
+      skipTlsVerify:
+        title: Skip TLS Verification
+        description: Skip TLS verification.
+        type: boolean
+        x-descriptors:
+        - urn:alm:descriptor:com.tectonic.ui:checkbox
+        default: false
+      https:
+        title: Secure
+        description: Use a secure HTTPS connection.
+        type: boolean
+        x-descriptors:
+        - urn:alm:descriptor:com.tectonic.ui:checkbox
+        default: true
+      time:
+        title: Time
+        description: Time this even occurred. By default, the time will be 
when this event hits the splunk server.
+        type: string
+  types:
+    in:
+      mediaType: application/json
+  dependencies:
+  - "camel:core"
+  - "camel:splunk-hec"
+  - "camel:kamelet"
+  template:
+    from:
+      uri: "kamelet:source"
+      steps:
+      - to:
+          uri: "splunk-hec:{{splunkUrl}}/{{token}}"
+          parameters:
+            host: "{{?hostPayload}}"
+            bodyOnly: "{{?bodyOnly}}"
+            headersOnly: "{{?headersOnly}}"
+            index: "{{?index}}"
+            source: "{{?source}}"
+            sourceType: "{{?sourceType}}"
+            skipTlsVerify: "{{?skipTlsVerify}}"
+            https: "{{?https}}"
+            time: "{{?time}}"
diff --git 
a/library/camel-kamelets/src/main/resources/kamelets/splunk-sink.kamelet.yaml 
b/library/camel-kamelets/src/main/resources/kamelets/splunk-sink.kamelet.yaml
new file mode 100644
index 00000000..993dea61
--- /dev/null
+++ 
b/library/camel-kamelets/src/main/resources/kamelets/splunk-sink.kamelet.yaml
@@ -0,0 +1,122 @@
+# ---------------------------------------------------------------------------
+# 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.
+# ---------------------------------------------------------------------------
+apiVersion: camel.apache.org/v1alpha1
+kind: Kamelet
+metadata:
+  name: splunk-sink
+  annotations:
+    camel.apache.org/kamelet.support.level: "Preview"
+    camel.apache.org/catalog.version: "main-SNAPSHOT"
+    camel.apache.org/kamelet.icon: 
"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHJvbGU9ImltZyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48dGl0bGU+U3BsdW5rIGljb248L3RpdGxlPjxwYXRoIGQ9Ik0yMy4zNDggMTEuOTExbC0yLjI0MS0xLjA5MXYtLjY1TDI0IDExLjYyMXYuNTkzbC0yLjg5MyAxLjQzOHYtLjYzNnptLTUuMzk3IDEuODQxaC0uOTYxdi01LjMxaC45NjF2My4xMTZoLjEwMmwxLjI4LTEuNDgxLjcyMy4zMS0xLjIzIDEuMzE2IDEuNDUzIDEuODA5LS44ODguMzExLTEuNDQtMS45OTZ6bS0yLjU3Ny0uMDAydi0yLjA2OG
 [...]
+    camel.apache.org/provider: "Apache Software Foundation"
+    camel.apache.org/kamelet.group: "SPLUNK"
+  labels:
+    camel.apache.org/kamelet.type: "sink"
+spec:
+  definition:
+    title: "Splunk Sink"
+    description: |-
+      Send data to Splunk either by using "submit" or "stream" mode.
+
+      The payload MUST be in json format.
+
+    required:
+      - serverHostname
+      - username
+      - password
+    type: object
+    properties:
+      serverHostname:
+        title: Splunk Server Address
+        description: The address of your Splunk server.
+        type: string
+        example: my_server_splunk.com
+      serverPort:
+        title: Splunk Server Port
+        description: The address of your Splunk server.
+        type: integer
+        default: 8089
+      username:
+        title: Username
+        description: The username to authenticate to Splunk Server.
+        type: string
+      password:
+        title: Password
+        description: The password to authenticate to Splunk Server.
+        type: string
+        format: password
+        x-descriptors:
+        - urn:alm:descriptor:com.tectonic.ui:password
+        - urn:camel:group:credentials
+      index:
+        title: Index
+        description: Splunk index to write to.
+        type: string
+      protocol:
+        title: Protocol
+        description: Connection Protocol to Splunk server.
+        type: string
+        default: https
+        enum: ["http", "https"]
+      source:
+        title: Source
+        description: The source named field of the data.
+        type: string
+      sourceType:
+        title: Source Type
+        description: The source named field of the data.
+        type: string
+      app:
+        title: Splunk App
+        description: The app name in Splunk.
+        type: string
+      connectionTimeout:
+        title: Connection Timeout
+        description: Timeout in milliseconds when connecting to Splunk server
+        type: integer
+        default: 5000
+      mode:
+        title: Mode
+        description: The mode to publish events to Splunk.
+        type: string
+        default: stream
+        enum: ["submit", "stream"]
+  types:
+    in:
+      mediaType: application/json
+  dependencies:
+  - "camel:core"
+  - "camel:splunk"
+  - "camel:kamelet"
+  template:
+    from:
+      uri: "kamelet:source"
+      steps:
+      - to:
+          uri: "splunk:{{mode}}"
+          parameters:
+            host: "{{serverHostname}}"
+            port: "{{serverPort}}"
+            username: "{{username}}"
+            password: "{{password}}"
+            source: "{{?source}}"
+            sourceType: "{{?sourceType}}"
+            scheme: "{{?protocol}}"
+            index: "{{?index}}"
+            app: "{{?app}}"
+            connectionTimeout: "{{?connectionTimeout}}"
+            raw: true
diff --git 
a/library/camel-kamelets/src/main/resources/kamelets/splunk-source.kamelet.yaml 
b/library/camel-kamelets/src/main/resources/kamelets/splunk-source.kamelet.yaml
new file mode 100644
index 00000000..3440990b
--- /dev/null
+++ 
b/library/camel-kamelets/src/main/resources/kamelets/splunk-source.kamelet.yaml
@@ -0,0 +1,159 @@
+# ---------------------------------------------------------------------------
+# 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.
+# ---------------------------------------------------------------------------
+apiVersion: camel.apache.org/v1alpha1
+kind: Kamelet
+metadata:
+  name: splunk-source
+  annotations:
+    camel.apache.org/kamelet.support.level: "Preview"
+    camel.apache.org/catalog.version: "main-SNAPSHOT"
+    camel.apache.org/kamelet.icon: 
"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHJvbGU9ImltZyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48dGl0bGU+U3BsdW5rIGljb248L3RpdGxlPjxwYXRoIGQ9Ik0yMy4zNDggMTEuOTExbC0yLjI0MS0xLjA5MXYtLjY1TDI0IDExLjYyMXYuNTkzbC0yLjg5MyAxLjQzOHYtLjYzNnptLTUuMzk3IDEuODQxaC0uOTYxdi01LjMxaC45NjF2My4xMTZoLjEwMmwxLjI4LTEuNDgxLjcyMy4zMS0xLjIzIDEuMzE2IDEuNDUzIDEuODA5LS44ODguMzExLTEuNDQtMS45OTZ6bS0yLjU3Ny0uMDAydi0yLjA2OG
 [...]
+    camel.apache.org/provider: "Apache Software Foundation"
+    camel.apache.org/kamelet.group: "SPLUNK"
+  labels:
+    camel.apache.org/kamelet.type: "source"
+spec:
+  definition:
+    title: "Splunk Source"
+    description: |-
+      Retrieve data from Splunk and outputs in json format.
+
+      For the fields accepting time specifiers like `earliestTime`, it accepts 
a wide variety of formats, please check 
https://docs.splunk.com/Documentation/Splunk/9.0.0/Search/Specifytimemodifiersinyoursearch[Splunk
 documentation] for more information.
+
+    required:
+      - serverHostname
+      - username
+      - password
+      - query
+    type: object
+    properties:
+      serverHostname:
+        title: Splunk Server Address
+        description: The address of your Splunk server.
+        type: string
+        example: my_server_splunk.com
+      serverPort:
+        title: Splunk Server Port
+        description: The address of your Splunk server.
+        type: integer
+        default: 8089
+      username:
+        title: Username
+        description: The username to authenticate to Splunk Server.
+        type: string
+      password:
+        title: Password
+        description: The password to authenticate to Splunk Server.
+        type: string
+        format: password
+        x-descriptors:
+        - urn:alm:descriptor:com.tectonic.ui:password
+        - urn:camel:group:credentials
+      index:
+        title: Index
+        description: Splunk index to write to.
+        type: string
+      protocol:
+        title: Protocol
+        description: Connection Protocol to Splunk server.
+        type: string
+        default: https
+        enum: ["http", "https"]
+      source:
+        title: Source
+        description: The source named field of the data.
+        type: string
+      sourceType:
+        title: Source Type
+        description: The source named field of the data.
+        type: string
+      app:
+        title: Splunk App
+        description: The app name in Splunk.
+        type: string
+      connectionTimeout:
+        title: Connection Timeout
+        description: Timeout in milliseconds when connecting to Splunk server
+        type: integer
+      count:
+        title: Count
+        description: The maximum number of entities to return.
+        type: integer
+      repeat:
+        title: Repeat
+        description: The maximum number of fires.
+        type: integer
+      delay:
+        title: Delay
+        description: Milliseconds before the next poll.
+        type: integer
+      query:
+        title: Query
+        description: The Splunk query to run.
+        type: string
+      earliestTime:
+        title: Earliest Time
+        description: Earliest time of the search time window.
+        type: string
+        example: "05/17/22 08:35:46:456"
+      initEarliestTime:
+        title: Init Earliest Time
+        description: Initial start offset of the first search.
+        type: string
+        example: "05/17/22 08:35:46:456"
+      latestTime:
+        title: Latest Time
+        description: Latest time of the search time window.
+        type: string
+        example: "05/17/22 08:35:46:456"
+  types:
+    out:
+      mediaType: application/json
+  dependencies:
+  - "camel:jackson"
+  - "camel:core"
+  - "camel:splunk"
+  - "camel:kamelet"
+  - "mvn:com.fasterxml.jackson.datatype:jackson-datatype-joda:2.12.5"
+  template:
+    from:
+      uri: "splunk:normal"
+      parameters:
+        host: "{{serverHostname}}"
+        port: "{{serverPort}}"
+        username: "{{username}}"
+        password: "{{password}}"
+        index: "{{?index}}"
+        scheme: "{{?protocol}}"
+        source: "{{?source}}"
+        sourceType: "{{?sourceType}}"
+        app: "{{?app}}"
+        connectionTimeout: "{{?connectionTimeout}}"
+        count: "{{?count}}"
+        repeatCount: "{{?repeat}}"
+        delay: "{{?delay}}"
+        search: "{{?query}}"
+        earliestTime: "{{?earliestTime}}"
+        initEarliestTime: "{{?initEarliestTime}}"
+        latestTime: "{{?latestTime}}"
+        raw: true
+      steps:
+      - marshal:
+          json:
+            library: Jackson
+            module-class-names: com.fasterxml.jackson.datatype.joda.JodaModule
+      - to: "kamelet:sink"
diff --git a/templates/bindings/camel-k/splunk-hec-sink-binding.yaml 
b/templates/bindings/camel-k/splunk-hec-sink-binding.yaml
new file mode 100644
index 00000000..09b79c18
--- /dev/null
+++ b/templates/bindings/camel-k/splunk-hec-sink-binding.yaml
@@ -0,0 +1,19 @@
+apiVersion: camel.apache.org/v1alpha1
+kind: KameletBinding
+metadata:
+  name: splunk-hec-sink-binding
+spec:
+  source:
+    ref:
+      kind: KafkaTopic
+      apiVersion: kafka.strimzi.io/v1beta1
+      name: my-topic
+  sink:
+    ref:
+      kind: Kamelet
+      apiVersion: camel.apache.org/v1alpha1
+      name: splunk-hec-sink
+    properties:
+      splunkUrl: "<splunk url>"
+      token: "HEC token"
+      skipTlsVerify: true
diff --git a/templates/bindings/camel-k/splunk-sink-binding.yaml 
b/templates/bindings/camel-k/splunk-sink-binding.yaml
new file mode 100644
index 00000000..9ff08eac
--- /dev/null
+++ b/templates/bindings/camel-k/splunk-sink-binding.yaml
@@ -0,0 +1,20 @@
+apiVersion: camel.apache.org/v1alpha1
+kind: KameletBinding
+metadata:
+  name: splunk-sink-binding
+spec:
+  source:
+    ref:
+      kind: KafkaTopic
+      apiVersion: kafka.strimzi.io/v1beta1
+      name: my-topic
+  sink:
+    ref:
+      kind: Kamelet
+      apiVersion: camel.apache.org/v1alpha1
+      name: splunk-sink
+    properties:
+      serverHostname: "<splunk server>"
+      username: "admin"
+      sourceType: grok
+      password: "<password>"
diff --git a/templates/bindings/camel-k/splunk-source-binding.yaml 
b/templates/bindings/camel-k/splunk-source-binding.yaml
new file mode 100644
index 00000000..b2b3e73e
--- /dev/null
+++ b/templates/bindings/camel-k/splunk-source-binding.yaml
@@ -0,0 +1,21 @@
+apiVersion: camel.apache.org/v1alpha1
+kind: KameletBinding
+metadata:
+  name: splunk-source-binding
+spec:
+  source:
+    ref:
+      kind: Kamelet
+      apiVersion: camel.apache.org/v1alpha1
+      name: splunk-source
+    properties:
+      serverHostname: "splunk address"
+      username: "admin"
+      password: "password"
+      query: "search Code=D | head 5"
+      initEarliestTime: "08/17/13 08:35:46:456"
+  sink:
+    ref:
+      kind: Kamelet
+      apiVersion: camel.apache.org/v1alpha1
+      name: log-sink
diff --git a/templates/bindings/core/splunk-hec-sink-binding.yaml 
b/templates/bindings/core/splunk-hec-sink-binding.yaml
new file mode 100644
index 00000000..451a19ae
--- /dev/null
+++ b/templates/bindings/core/splunk-hec-sink-binding.yaml
@@ -0,0 +1,15 @@
+- route:
+    from:
+      uri: "kamelet:timer-source"
+      parameters:
+        period: 20000
+        message: '{"event": "hello splunk from camel k"}'
+      steps:
+        - to:
+            uri: "kamelet:splunk-hec-sink"
+            parameters:
+              splunkUrl: "server address"
+              token: "token"
+              index: main
+              skipTlsVerify: true
+
diff --git a/templates/bindings/core/splunk-sink-binding.yaml 
b/templates/bindings/core/splunk-sink-binding.yaml
new file mode 100644
index 00000000..5a799f8e
--- /dev/null
+++ b/templates/bindings/core/splunk-sink-binding.yaml
@@ -0,0 +1,13 @@
+- route:
+    from:
+      uri: "kamelet:timer-source"
+      parameters:
+        period: 1000
+        message: '{"event": "hello splunk from camel k"}'
+      steps:
+        - to:
+            uri: "kamelet:splunk-sink"
+            parameters:
+              serverHostname: "<splunk server>"
+              username: "admin"
+              password: "<password>"
diff --git a/templates/bindings/core/splunk-source-binding.yaml 
b/templates/bindings/core/splunk-source-binding.yaml
new file mode 100644
index 00000000..0a16ee13
--- /dev/null
+++ b/templates/bindings/core/splunk-source-binding.yaml
@@ -0,0 +1,12 @@
+- route:
+    from:
+      uri: "kamelet:splunk-source"
+      parameters:
+        serverHostname: "<splunk address>"
+        username: "admin"
+        password: "password"
+        query: "query"
+        initEarliestTime: "08/17/13 08:35:46:456"
+      steps:
+        - to:
+            uri: "kamelet:log-sink"

Reply via email to