[[inputs.mqtt_consumer]]
servers = ["tcp://zancudo.sytes.net:1883"]
qos = 0
connection_timeout = "30s"
topics = [
"teodolinda/gerencia/temp",
"teodolinda/gerencia/humidity",
"teodolinda/recepcion/temp",
]
persistent_session = false
client_id = ""
data_format = "influx"
Fedora 29
telegraf-1.9.2-1.x86_64
influxdb-1.7.3-1.x86_64
kernel-4.18.16-300.fc29.x86_64
systemctl start influxdb.service
systemctl start telegraf.service
systemctl status telegraf.service
messages get into influxdb
Jan 19 23:51:33 localhost.localdomain telegraf[1814]: 2019-01-20T05:51:33Z I! [inputs.mqtt_consumer] Connected [tcp://zancudo.sytes.net:1883]
Jan 19 23:51:45 localhost.localdomain telegraf[1814]: 2019-01-20T05:51:45Z E! [inputs.mqtt_consumer]: Error in plugin: metric parse error: expected field at offset 9: "29.700001"
Jan 19 23:51:45 localhost.localdomain telegraf[1814]: 2019-01-20T05:51:45Z E! [inputs.mqtt_consumer]: Error in plugin: metric parse error: expected field at offset 9: "57.000000"
Jan 19 23:51:46 localhost.localdomain telegraf[1814]: 2019-01-20T05:51:46Z E! [inputs.mqtt_consumer]: Error in plugin: metric parse error: expected field at offset 6: "31.875"
Telegraf is working as I can see data in Chronograf from the system (cpu, disk, mem).
I was looking if I needed some configuration for the values, but I find this "There are no additional configuration options for InfluxDB line protocol. The metrics are parsed directly into Telegraf metrics."
I saw issue #4463 that it is similar, but it was not resolved.
It looks like the data in mqtt is not formatted as expected, when set to data_format = "influx" the plugin is expecting line protocol.
From the log message it looks like you have raw values. Try using the value data_format by adding these lines instead of data_format = "influx":
data_format = "value"
data_type = "float"
It worked. Thanks
if i solve this telegraf error only ill get data in influxDB or what
Most helpful comment
It looks like the data in mqtt is not formatted as expected, when set to
data_format = "influx"the plugin is expecting line protocol.From the log message it looks like you have raw values. Try using the
valuedata_format by adding these lines instead ofdata_format = "influx":