I get a Telegraph error that looks like this:
Feb 19 09:48:26 waldo telegraf[20970]: 2020-02-19T08:48:26Z I! Starting Telegraf 1.13.2
Feb 19 09:48:26 waldo telegraf[20970]: 2020-02-19T08:48:26Z E! Could not parse tags for input mqtt_consumer
Feb 19 09:48:26 waldo telegraf[20970]: 2020-02-19T08:48:26Z I! Loaded inputs: mqtt_consumer mqtt_consumer
Feb 19 09:48:26 waldo telegraf[20970]: 2020-02-19T08:48:26Z I! Loaded aggregators:
Feb 19 09:48:26 waldo telegraf[20970]: 2020-02-19T08:48:26Z I! Loaded processors:
Feb 19 09:48:26 waldo telegraf[20970]: 2020-02-19T08:48:26Z I! Loaded outputs: file influxdb
Feb 19 09:48:26 waldo telegraf[20970]: 2020-02-19T08:48:26Z I! Tags enabled:
Feb 19 09:48:26 waldo telegraf[20970]: 2020-02-19T08:48:26Z I! [agent] Config: Interval:5s, Quiet:false, Hostname:"", Flush Interval:10s
Feb 19 09:48:26 waldo telegraf[20970]: 2020-02-19T08:48:26Z I! [inputs.mqtt_consumer] Connected [tcp://127.0.0.1:1883]
Feb 19 09:48:26 waldo telegraf[20970]: 2020-02-19T08:48:26Z I! [inputs.mqtt_consumer] Connected [tcp://127.0.0.1:1883]
Feb 19 09:48:26 waldo telegraf[20970]: 2020-02-19T08:48:26Z E! [inputs.mqtt_consumer] Error in plugin: metric parse error: expected tag at 1:36: "{\"batt\":70,\"lon\":12.940846888889837,\"acc\":65,\"p\":97.19
Feb 19 09:48:26 waldo telegraf[20970]: 2020-02-19T08:48:26Z E! [inputs.mqtt_consumer] Error in plugin: metric parse error: expected tag at 1:29: "{\"_type\":\"location\",\"acc\":17,\"alt\":0,\"batt\":95,\"con
I have to consumers on different topics with mqtt. One is working fine, the other is not.
My input data looks like this:
{
"batt": 70,
"lon": xx.xxxxxxxxxxx,
"acc": 65,
"p": 97.19798278808594,
"bs": 2,
"vac": 10,
"lat": xx.xxxxxxxxxxx,
"t": "u",
"conn": "w",
"tst": xxxxxxxxxx,
"alt": 318,
"_type": "location",
"tid": "kt"
}
My telegraph config looks like this:
[[inputs.mqtt_consumer]]
servers = ["tcp://127.0.0.1:1883"]
username = "telegraf"
password = "xxxxxxxx"
topics = [
"owntracks/#",
]
[inputs.mqtt_consumer.tags]
db = "owntracks_data"
data_format = "json"
name_override = "location"
json_time_key = "tst"
json_time_format = "unix"
tag_keys = ["tid"]
Something seems to be missing. But I can’t figure it out. Can someone help?