Environment variable syntax problems for beats monitoring

I'm trying to pass through the monitoring elasticsearch cluster hostname as an enterprise variable and set in the metricbeat.yml and filebeat.yml. The variable is:

MONITORING_ELASTICSEARCH=elk-001

Hardcoding the name works like this:

monitoring:
  enabled: true
  elasticsearch:
    hosts: ["elk-001"]

I've tried these syntaxes for the enterprise variable, but none of them work, and the documentation is not too clear: https://www.elastic.co/guide/en/beats/filebeat/current/using-environ-vars.html

monitoring:
  enabled: true
  elasticsearch:
    hosts: ["$elk-001"] or hosts: ${elk-001}

or many others but it doesn't work.

Have you tried

monitoring:
  enabled: true
  elasticsearch.hosts: '$MONITORING_ELASTICSEARCH'

?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.