Please help me correct this inputs.exec. I do not see the data being written to influx, and debug isn’t offering anything useful. I have the following in my telegraf.conf
[[inputs.exec]]
interval = "5s"
commands = ["/usr/local/bin/myip"]
timeout = "5s"
data_format = "json"
name_suffix = "_myipaddr"
Debug isn’t offering anything.
# telegraf --debug --config /etc/telegraf/telegraf.conf --test
2020-05-26T00:49:54Z I! Starting Telegraf 1.14.3
#
/usr/local/bin/myip
#!/bin/sh
ipaddr=`/sbin/ifconfig tun0 | grep 'inet' | cut -d: -f2 | awk '{print $2}'`
printf '{"ipaddr": "%s"}\n' $ipaddr