Install the Splunk Distribution of OpenTelemetry Collector for Kafka with Ansible
Install the Splunk Distribution of OpenTelemetry Collector for Kafka on a Linux or macOS host by using the Ansible playbook.
The playbook creates a basic configuration in values.yaml. Edit the file to meet your requirements. For more configuration options, see Configure the Splunk Distribution of OpenTelemetry Collector for Kafka.
Prerequisites
The playbook supports Linux and macOS. It does not support Windows.
Before you begin, make sure that you have the following prerequisites:
-
A running instance of Splunk
-
A valid HTTP Event Collector (HEC) token
-
An index for Kafka logs, such as
kafka_otel
-
-
A running instance of Kafka
-
Network connectivity among Kafka, the Splunk platform, and the host where you will install the collector
-
Ansible installed on the host where you will install the collector
Install the Splunk Distribution of OpenTelemetry Collector for Kafka
-
Download the Ansible script install_soc4kafka_collector.yaml:
wget https://raw.githubusercontent.com/splunk/splunk-opentelemetry-collector-for-kafka/refs/heads/main/quickstart/install_soc4kafka_collector.yaml
-
Set the variables in the Ansible script. For descriptions, see Ansible variables.
-
Run the Ansible playbook:
ansible-playbook install_soc4kafka_collector.yaml
-
After the playbook finishes, run the command it provides to start the collector. For example:
./<otelcol_binary_file_name> --config values.yaml
When the collector is running, its logs appear in the Splunk platform. For more configuration options, see Configure the Splunk Distribution of OpenTelemetry Collector for Kafka.
Ansible variables
|
Variable |
Type |
Description |
Allowed values |
Default |
Example |
|---|---|---|---|---|---|
|
|
Boolean |
Set to |
|
|
- |
|
|
String |
Operating system. |
|
|
- |
|
|
String |
System architecture. |
|
|
- |
|
|
String |
Comma-separated Kafka broker addresses in the format |
- |
- |
|
|
|
String |
Kafka topic from which to collect messages. |
- |
- |
|
|
|
String |
Kafka message encoding format. |
|
|
- |
|
|
Boolean |
Set to |
|
|
- |
|
|
String |
HTTP Event Collector (HEC) token for authentication. |
- |
- |
|
|
|
String |
Splunk HEC endpoint URL. |
- |
- |
|
|
|
String |
Source value to assign to events sent to Splunk. |
- |
- |
|
|
|
String |
Sourcetype value to assign to events sent to Splunk. |
- |
- |
|
|
|
String |
Splunk index where events are stored. |
- |
- |
|