Skip to content

Commit e8fa525

Browse files
chepatiIvan Kabaivanov
andauthored
Allow for passing a splunk_access_token variable instead of the o11y access token so we can ingest logs into Splunk Cloud. (#3720)
Co-authored-by: Ivan Kabaivanov <[email protected]>
1 parent addc896 commit e8fa525

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed

deployments/ansible/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,12 @@ Note that this role requires root access.
5454
name: "signalfx.splunk_otel_collector.collector"
5555
vars:
5656
splunk_access_token: YOUR_ACCESS_TOKEN
57+
splunk_hec_token: YOUR_HEC_TOKEN
5758
splunk_realm: SPLUNK_REALM
5859
```
5960
61+
> **_NOTE:_** Setting splunk_hec_token is optional.
62+
6063
Full documentation on how to configure the role:
6164
[Splunk OpenTelemetry Collector Role](https://github.com/signalfx/splunk-otel-collector/tree/main/deployments/ansible/roles/collector)
6265

deployments/ansible/roles/collector/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,12 @@ how to use the role in a playbook with minimal required configuration:
3131
name: "signalfx.splunk_otel_collector.collector"
3232
vars:
3333
splunk_access_token: YOUR_ACCESS_TOKEN
34+
splunk_hec_token: YOUR_HEC_TOKEN
3435
splunk_realm: SPLUNK_REALM
3536
```
3637
38+
> **_NOTE:_** Setting splunk_hec_token is optional.
39+
3740
You can disable starting the collector and fluentd services by setting
3841
the argument `start_service` to `false`:
3942

deployments/ansible/roles/collector/tasks/linux_install.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@
2828
notify: "restart splunk-otel-collector"
2929
when: splunk_otel_collector_proxy_http != "" or splunk_otel_collector_proxy_https != ""
3030

31+
- name: Set default hec token
32+
set_fact:
33+
splunk_hec_token: "{{splunk_access_token}}"
34+
when: splunk_hec_token is not defined or (splunk_hec_token | trim) == ""
35+
3136
- name: Set up env file for Splunk OTel Collector service
3237
ansible.builtin.template:
3338
src: splunk-otel-collector.conf.j2

deployments/ansible/roles/collector/templates/splunk-otel-collector.conf.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ SPLUNK_HEC_URL={{ splunk_ingest_url + "/v1/log" }}
1717
{% else %}
1818
SPLUNK_HEC_URL={{ "https://ingest." + splunk_realm + ".signalfx.com/v1/log" }}
1919
{% endif %}
20-
SPLUNK_HEC_TOKEN={{ splunk_access_token }}
20+
SPLUNK_HEC_TOKEN={{ splunk_hec_token }}
2121
SPLUNK_MEMORY_TOTAL_MIB={{ splunk_memory_total_mib }}
2222
SPLUNK_BALLAST_SIZE_MIB={{ splunk_ballast_size_mib }}
2323
SPLUNK_LISTEN_INTERFACE={{ splunk_listen_interface }}

0 commit comments

Comments
 (0)