Send telemetry to Splunk
Send IRIS telemetry to Splunk Enterprise or Splunk Cloud Platform through an OpenTelemetry Collector. Every hostname, address, and path below is an example.
Configure both paths: IRIS sends logs and metrics to collector port 4318
over OTLP (OpenTelemetry Protocol); the collector scrapes IRIS port 9101
for the peer and origin-byte metrics the views read.
Indexes and HEC token
-
In Settings → Indexes, create both indexes and grant dashboard users search access.
Index Data type Source Sourcetype iris_logsEvents irisotel:logsiris_metricsMetrics irisotel:metrics -
On Splunk Enterprise, open Settings → Data inputs → HTTP Event Collector → Global Settings. HEC is Splunk's HTTP Event Collector, the endpoint the collector writes to. Turn it on, select Enable SSL, set the port to
8088, and leave indexer acknowledgment off. See Splunk's HEC setup instructions. - Install a HEC certificate whose subject alternative name matches its hostname.
- Create an enabled token named
iris-otel, allow both indexes, and setiris_logsas its default index.
On Splunk Cloud Platform, create the indexes and token the way your stack
supports, then use its HEC ingest endpoint, including /services/collector,
in both exporters below. Managed stacks normally use port 443; trial stacks
can use 8088.
Each token has one job: HEC writes to Splunk, the collector bearer token lets IRIS submit OTLP, and the observability token reads /metrics.
Files and tokens
On the collector host, make a working directory outside the IRIS checkout for
compose.yaml, otel-collector.yaml, secrets/, and tls/. It holds:
| File on collector host | Contents |
|---|---|
tls/collector.crt, tls/collector.key |
Collector certificate chain and private key, valid for collector.example.com |
tls/splunk-ca.pem |
CA certificates that validate splunk.example.com |
tls/iris-catalog.pem |
IRIS server's public catalog certificate or issuing CA |
secrets/collector-token |
Raw bearer token accepted by the collector |
secrets/iris-observability-token |
Raw token configured on the IRIS server for /metrics |
Warning
Keep .env, private keys, and tokens out of version control.
Get the collector and HEC certificates from your certificate authority, and
copy artifacts/iris-catalog.pem from IRIS over an authenticated channel. When
the HEC endpoint is already trusted by the collector's system roots, omit its
tls.ca_file and the matching mount instead of supplying a separate CA file.
-
Create the collector bearer token on the collector host.
umask 077 mkdir -p secrets tls openssl rand -hex 32 > secrets/collector-token -
Follow Export telemetry to create the IRIS observability token and the OTLP header file. Copy the raw token to
secrets/iris-observability-token; the header file holdsAuthorization=Bearerand the value insecrets/collector-token. -
Give the mounted files to the collector account, user and group id
10001.sudo chown -R 10001:10001 secrets tls sudo chmod 0700 secrets tls sudo chmod 0600 secrets/* tls/collector.key sudo chmod 0644 tls/*.crt tls/*.pem -
Save
.envwith mode0600, replacing both values.COLLECTOR_BIND_IP=192.0.2.10 SPLUNK_HEC_TOKEN=replace-with-your-hec-token
Configure the collector
Run Collector Contrib, the distribution that carries splunk_hec. Its fields
are documented in the
exporter reference,
bearer authentication extension,
and filter processor.
-
Save
compose.yaml.services: otel-collector: image: otel/opentelemetry-collector-contrib:0.160.0 user: "10001:10001" restart: unless-stopped command: ["--config=/etc/otelcol/otel-collector.yaml"] environment: SPLUNK_HEC_TOKEN: "${SPLUNK_HEC_TOKEN:?Set SPLUNK_HEC_TOKEN}" volumes: - ./otel-collector.yaml:/etc/otelcol/otel-collector.yaml:ro - ./secrets:/etc/otelcol/secrets:ro - ./tls:/etc/otelcol/tls:ro ports: - "${COLLECTOR_BIND_IP:?Set COLLECTOR_BIND_IP}:4318:4318" - "127.0.0.1:8888:8888" -
Open the paths between the hosts: the IRIS server to collector port
4318, the collector to IRIS port9101, and the collector to your HEC port. -
Save
otel-collector.yaml, replacing the example hostnames. If you scrapeiris.example.com:9101by an address that does not match the name oniris-catalog.pem, addtls_config.server_nametoprometheus/iris9101and set it to the name the certificate is valid for.extensions: bearertokenauth/iris: filename: /etc/otelcol/secrets/collector-token receivers: otlp/iris: protocols: http: endpoint: 0.0.0.0:4318 tls: cert_file: /etc/otelcol/tls/collector.crt key_file: /etc/otelcol/tls/collector.key auth: authenticator: bearertokenauth/iris prometheus/iris9101: config: scrape_configs: - job_name: iris-9101 scrape_interval: 15s scheme: https authorization: type: Bearer credentials_file: /etc/otelcol/secrets/iris-observability-token tls_config: ca_file: /etc/otelcol/tls/iris-catalog.pem static_configs: - targets: ["iris.example.com:9101"] processors: filter/iris_logs: error_mode: propagate log_conditions: - 'resource.attributes["service.name"] != "iris-tracker"' filter/iris_metrics: error_mode: propagate metric_conditions: - 'not IsMatch(metric.name, "^iris[._].*")' batch: send_batch_size: 512 timeout: 5s exporters: splunk_hec/iris_logs: token: "${env:SPLUNK_HEC_TOKEN}" endpoint: https://splunk.example.com:8088/services/collector index: iris_logs source: iris sourcetype: otel:logs tls: ca_file: /etc/otelcol/tls/splunk-ca.pem retry_on_failure: enabled: true sending_queue: enabled: true splunk_hec/iris_metrics: token: "${env:SPLUNK_HEC_TOKEN}" endpoint: https://splunk.example.com:8088/services/collector index: iris_metrics source: iris sourcetype: otel:metrics tls: ca_file: /etc/otelcol/tls/splunk-ca.pem retry_on_failure: enabled: true sending_queue: enabled: true service: extensions: [bearertokenauth/iris] telemetry: metrics: level: detailed readers: - pull: exporter: prometheus: host: 0.0.0.0 port: 8888 pipelines: logs/iris_splunk: receivers: [otlp/iris] processors: [filter/iris_logs, batch] exporters: [splunk_hec/iris_logs] metrics/iris_splunk: receivers: [otlp/iris] processors: [filter/iris_metrics, batch] exporters: [splunk_hec/iris_metrics] metrics/iris9101: receivers: [prometheus/iris9101] processors: [filter/iris_metrics, batch] exporters: [splunk_hec/iris_metrics]Filters name records to drop; these keep IRIS logs and dotted or underscored metric names. Merge these components into a shared collector.
The
sending_queueis in memory. Use persistent queue support to retain queued data when the collector is replaced. -
Validate the configuration and start the collector.
docker compose run --rm --no-deps otel-collector validate --config=/etc/otelcol/otel-collector.yaml docker compose up -d otel-collector docker compose logs --tail 50 otel-collector
Turn on export in IRIS
Turn OTLP export on in the server deployment file and point it at the collector base URL, as Export telemetry describes.
Verify delivery
-
Read the collector counters. Accepted and sent counts rise while IRIS exports.
curl --fail --silent --show-error http://127.0.0.1:8888/metrics \ | rg 'otelcol_(receiver_accepted|exporter_sent|exporter_send_failed)' -
In Splunk, list the log records from the last day.
index=iris_logs source=iris sourcetype=otel:logs earliest=-24h | stats count BY "otel.log.name", "service.version" -
In Splunk, list the metric names from the last two hours.
| mcatalog values(metric_name) WHERE index=iris_metrics earliest=-2hExpect
iris.transfer.*OTLP names,iris_*scrape names, andiris_tracker_up. Per-image byte series appear once that image has data.
Import the views
Both supplied views read iris_logs and iris_metrics; edit their searches if you chose other names.
- Download splunk-iris-swarm.xml and splunk-iris-rollout.xml.
- Open Settings → User interface → Views → New View, choose the app context, paste the file contents as the XML source, and save.
To update a view you already imported, save its definition and permissions, keep its name, app, owner, and sharing, and post the new XML to its own endpoint. That keeps the saved time picker and device filter.
Troubleshooting
| Symptom | Likely cause | What to do |
|---|---|---|
| The collector cannot read a file | A mount path or a file mode | Check the bind-mount paths, directory traversal permissions, and that user id 10001 can read the file. |
| Nothing arrives and IRIS shows export off | OTLP export is not enabled | Turn OTLP export on, set the base endpoint, and check for a saved Console override. |
| IRIS shows export degraded | The collector is unreachable, or its certificate does not match | Check name resolution, port 4318, the certificate name and its CA, and the OTLP header file. |
The collector returns 401 |
The OTLP bearer token does not match the collector token file | Copy the raw value again. Do not write a second Bearer prefix. |
The IRIS scrape returns 401 |
The observability token on the collector is wrong | Check the raw token file on the collector and the token file the IRIS server reads. |
The IRIS scrape returns 404 after it authenticates |
The metrics endpoint is off on the server | Turn observability on and recreate the server container. |
| TLS validation fails | The issuing CA is missing, or the name does not match | Install the issuing CA and connect to a name or address in the certificate. Keep certificate verification on. |
| HEC reports an invalid token | Wrong token value, or the token is disabled | Check the token value, that it is enabled, and that you send to the right stack. |
| HEC reports an incorrect index | An index is missing or not allowed on the token | Create both indexes and allow them on the token. iris_metrics must be a Metrics index. |
| Log searches return rows, metric panels stay empty | The scrape path is not delivering | Check the /metrics scrape and the metrics/iris9101 pipeline. OTLP metrics alone do not supply every family the views use. |
Check export health in Console telemetry status and collector logs. For incorrect panels, see Troubleshoot: symptoms and first steps.