Does .conf files support environment variables?

Hi. Is it possible to do something like this in a conference file?:

agents=[ $SWITCH_IP ]

And pass the variable as a linux environment variable?

Yes, env variables are supported in the telegraf conf file:

https://docs.influxdata.com/telegraf/v1.19/administration/configuration/#set-environment-variables