Skip to content

Commit 97f1fa0

Browse files
authored
Update splunk-otel-collector.conf.erb
* Allow HEC token to be in run_state * Fix access to additional env_vars
1 parent 861fd23 commit 97f1fa0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

deployments/chef/templates/splunk-otel-collector.conf.erb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
SPLUNK_CONFIG=<%= node['splunk_otel_collector']['collector_config_dest'] %>
33

44
# Access token to authenticate requests.
5-
SPLUNK_ACCESS_TOKEN=<%= node['splunk_otel_collector']['splunk_access_token'] || node.run_state['splunk_otel_collector']['splunk_access_token'] %>
5+
SPLUNK_ACCESS_TOKEN=<%= node.run_state['splunk_otel_collector']['splunk_access_token'] || node['splunk_otel_collector']['splunk_access_token'] %>
66

77
# Which realm to send the data to.
88
SPLUNK_REALM=<%= node['splunk_otel_collector']['splunk_realm'] %>
@@ -17,7 +17,7 @@ SPLUNK_INGEST_URL=<%= node['splunk_otel_collector']['splunk_ingest_url'] %>
1717
SPLUNK_HEC_URL=<%= node['splunk_otel_collector']['splunk_hec_url'] %>
1818

1919
# Splunk HEC token.
20-
SPLUNK_HEC_TOKEN=<%= node['splunk_otel_collector']['splunk_hec_token'] %>
20+
SPLUNK_HEC_TOKEN=<%= node.run_state['splunk_otel_collector']['splunk_hec_token'] || node['splunk_otel_collector']['splunk_hec_token'] %>
2121

2222
# Total memory in MIB to allocate to the collector.
2323
# Automatically configures the memory limit.
@@ -40,6 +40,6 @@ SPLUNK_BUNDLE_DIR=<%= node['splunk_otel_collector']['splunk_bundle_dir'] %>
4040
SPLUNK_COLLECTD_DIR=<%= node['splunk_otel_collector']['splunk_collectd_dir'] %>
4141

4242
# Additional environment variables.
43-
<% @node['splunk_otel_collector']['collector_additional_env_vars'].each do |key,value| -%>
43+
<% node['splunk_otel_collector']['collector_additional_env_vars'].each do |key,value| -%>
4444
<%= key %>=<%= value %>
4545
<% end -%>

0 commit comments

Comments
 (0)