Environment setting for telegraf



hi, all.
when I setting telegraf config file, use the environment variable as below:


since the ‘zookeeper_urls’ is environment variable
export zookeeper_urls=’[“”,“”,]’

when I start telegraf with this config, it outputs no such host, change the file without environment variable as below it works.

it seem that the “zookeeper_urls” is prase as a string result , not extractly to the severs array.

I wonder is any method config a array environment variable, or config a entire environment variable outside the config file


Environment variables are replaced before the toml is parsed, so this won’t expand correctly. You can try removing the brackets

server = $zookeeper_urls