This repository contains a technical addon that exposes a OTLP endpoint for consumption of logs, traces and metrics.
The input is configured as a data input in the Splunk Data Input settings.
You can set:
- The gRPC port and HTTP ports the OTLP receiver will listen on
- The network interface address on which the OTLP input will listen.
When sending OTLP data, this input interprets resource attributes to create HEC equivalents.
This table shows the resource attributes mapping:
| Resource attribute | HEC event field |
|---|---|
| com.splunk.index | index |
| com.splunk.sourcetype | sourcetype |
| com.splunk.source | source |
| host.name | host |
OpenTelemetry protocol representation of a log record contains additional fields. The table below shows the mapping of those fields to HEC event indexed fields:
| Log record field | HEC event indexed field |
|---|---|
| Severity text | otel.log.severity.text |
| Severity number | otel.log.severity.number |
All other resource and individual log record attributes are mapped to indexed fields.
This mapping follows the OpenTelemetry specification.
Prerequisites:
- Go 1.24
- Make
Run:
$> make tgzThis will build the binaries, and assemble the TA tar.gz archive.
The archive is created as splunk-connect-for-otlp.tgz.
You can run a local Splunk instance with:
make splunkLog in with admin/changeme.
Install the application by going to Apps > Manage Apps > Install application from file.
See the example folder for a collector configuration.
You can generate a payload using telemetrygen.
Install telemetrygen with:
go install github.com/open-telemetry/opentelemetry-collector-contrib/cmd/telemetrygen@latestTry running telemetrygen with:
$> telemetrygen metrics --otlp-insecure --otlp-endpoint 0.0.0.0:4317 --metrics 100 --workers 10
$> telemetrygen logs --otlp-insecure --otlp-endpoint 0.0.0.0:4317 --logs 100 --workers 10
$> telemetrygen traces --otlp-insecure --otlp-endpoint 0.0.0.0:4317 --traces 100 --workers 10To try sending data to different indexes, add a resource attribute with the --otlp-attributes parameter.
Example to send to the foo metric index:
$> telemetrygen metrics --otlp-insecure --otlp-endpoint 0.0.0.0:4317 --metrics 100 --workers 10 --otlp-attributes com.splunk.index=\"foo\"The following binaries are written in Go present in the source repository:
- linux_x86_64/bin/splunk-connect-for-otlp
- windows_x86_64/bin/splunk-connect-for-otlp