Telegraf SQL Input to multiple dsns


I have a structure that is SQL Server + Telegraf + Prometheus + Grafana.
I was able to configure my telegraf agent to use multiple custom SQL Queries to get the data needed.
Now I need to escalate this to multiple servers and multiple DBs.
All the DB’s have the same structure.
My question: is it possible to have a connection.conf (for example) and use this to point the same query to the different sql servers?

I didn’t want to
dsns = “server1”
query=" select 1 "

dsns = “server2”
query=" select 1 "


No, this is the way to go.

What you could do however, is using a templating engine or config management solution to generate this config for you where you only need to provide it a list of dsns to connect to.

1 Like

As @Hipska said the easiest solution is to use a templating engine to write the config…
but What you asked is/was a feature request #12882