I am not experienced with Telegraf and I have run into this problem. The config was previously working, but then something changed and I don’t know what the issue is (and didn’t backup the working config!).
So any help would be appreciated.
I have configured Telegraf to collect from an mqtt queue, but it is not working and I can’t see the reason why.
2022-11-15T19:30:13Z E! [telegraf] Error running agent: Error loading config file /etc/telegraf/telegraf.conf: plugin inputs.mqtt_consumer: line 128: configuration specified the fields [“measurement_name”], but they weren’t used
The relevant config
# Configuration for sending metrics to InfluxDB
[[outputs.influxdb_v2]]
urls = ["<removed>.aws.cloud2.influxdata.com"]
bucket = "ems-esp"
token = "<removed>"
organization = "<removed>"
# Below is line 128 where the error occurs
[[inputs.mqtt_consumer]]
## Broker URLs for the MQTT server or cluster. To connect to multiple
## clusters or standalone servers, use a separate plugin instance.
## example: servers = ["tcp://localhost:1883"]
## servers = ["ssl://localhost:1883"]
## servers = ["ws://localhost:1883"]
servers = ["tcp://192.168.178.61:1883"]
topics = [
"ems-esp/boiler_data_ww",
"ems-esp/boiler_data",
"ems-esp/thermostat_data",
"ems-esp/thermostat_data_hc1",
"ems-esp/solar_data",
"ems-esp/heartbeat",
"ems-esp/info",
]
data_format = "json"
[[inputs.mqtt_consumer]]
servers = ["tcp://192.168.178.61:1883"]
topics = [
"shellies/ht_lounge/info"
]
data_format = "json"
But the line the error points to is just the definition [[inputs.mqtt_consumer]]
and I don’t see the problem. Nor can I find anything else in the file that is incorrect.
I am running Telegraf in docker, in case that makes a difference.
Thanks.