Chapter 73. Splunk Sink
Send data to Splunk either by using "submit" or "stream" mode.
The payload MUST be in json format.
73.1. Configuration Options Copy linkLink copied to clipboard!
The following table summarizes the configuration options available for the splunk-sink Kamelet:
| Property | Name | Description | Type | Default | Example |
|---|---|---|---|---|---|
| password * | Password | The password to authenticate to Splunk Server. | string | ||
| serverHostname * | Splunk Server Address | The address of your Splunk server. | string | my_server_splunk.com | |
| username * | Username | The username to authenticate to Splunk Server. | string | ||
| app | Splunk App | The app name in Splunk. | string | ||
| connectionTimeout | Connection Timeout | Timeout in milliseconds when connecting to Splunk server | integer | 5000 | |
| index | Index | Splunk index to write to. | string | ||
| mode | Mode | The mode to publish events to Splunk. | string | stream | |
| protocol | Protocol | Connection Protocol to Splunk server. | string | https | |
| serverPort | Splunk Server Port | The address of your Splunk server. | integer | 8089 | |
| source | Source | The source named field of the data. | string | ||
| sourceType | Source Type | The source named field of the data. | string |
* = Fields marked with an asterisk are mandatory.
73.2. Dependencies Copy linkLink copied to clipboard!
73.2.1. Quarkus dependencies Copy linkLink copied to clipboard!
73.3. Usage Copy linkLink copied to clipboard!
73.3.1. Camel JBang usage Copy linkLink copied to clipboard!
73.3.1.1. Prerequisites for Jbang Copy linkLink copied to clipboard!
- Install JBang.
Install
camelas a JBang command by running:jbang app install camel@apache/camel
jbang app install camel@apache/camelCopy to Clipboard Copied! Toggle word wrap Toggle overflow
For example, you have a file named route.yaml with this content.
You can run it directly through the following command.
camel run route.yaml
camel run route.yaml
73.3.2. Kafka Sink Copy linkLink copied to clipboard!
You can use the splunk-sink Kamelet as a Kafka sink by binding it to a Kafka topic.
splunk-sink-binding.yaml
73.3.3. Prerequisites for Kafka Copy linkLink copied to clipboard!
- Install Strimzi.
-
You must create a topic named
my-topicin the current namespace.
73.3.3.1. Procedure for using the cluster CLI with Kafka Copy linkLink copied to clipboard!
-
Save the
splunk-sink-binding.yamlfile to your local drive, and then edit it as needed for your configuration. Run the sink with the following command:
kubectl apply -f splunk-sink-binding.yaml
kubectl apply -f splunk-sink-binding.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow
73.3.3.2. Procedure for using the Kamel CLI with Kafka Copy linkLink copied to clipboard!
Configure and run the sink with the following command.
kamel bind splunk-sink -p "sink.password=The Password" -p "sink.serverHostname=my_server_splunk.com" -p "sink.username=The Username" kafka.strimzi.io/v1beta1:KafkaTopic:my-topic
kamel bind splunk-sink -p "sink.password=The Password" -p "sink.serverHostname=my_server_splunk.com" -p "sink.username=The Username" kafka.strimzi.io/v1beta1:KafkaTopic:my-topic
This command creates the Pipe in the current namespace on the cluster.