Hi,
I use the Telegraf http plugin to query a server which requires authentication. This authentication is based a special header containing a special token. So far so good.
However, the server requires the token to be updated regularly (like once an hour), which causes my http plugin to lose the connection after a while if I hardcode the token in /etc/telegraf/telegraf.conf.
So, first question is, can I use an environment variable to define the header, like so:
[[inputs.http]]
headers = {"X-My-Special-Header" = "${MYAUTH}"}
With, in /etc/default/telegraf:
MYAUTH="xxxxxxxxxxxxxxxxxxxxx"
?
It does not seem to work right now, I get a 403 error from the server (whereas it works fine if I hardcode directly the header and its value into /etc/telegraf/telegraf.conf).
Also, is this method the best one? I mean by this, does telegraf keep track of updates in /etc/default/telegraf without having to restart the telegraf service?
If not, do I have another option?
Many thanks