Telegraf: input.mqtt_consumer metric parse error

Created on 20 Jan 2019  路  3Comments  路  Source: influxdata/telegraf

Relevant telegraf.conf:

[[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"

System info:

Fedora 29
telegraf-1.9.2-1.x86_64
influxdb-1.7.3-1.x86_64
kernel-4.18.16-300.fc29.x86_64

Steps to reproduce:

systemctl start influxdb.service
systemctl start telegraf.service
systemctl status telegraf.service

Expected behavior:

messages get into influxdb

Actual behavior:

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"

Additional info:

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.

discussion

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 value data_format by adding these lines instead of data_format = "influx":

data_format = "value"
data_type = "float"

All 3 comments

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hluaces picture hluaces  路  3Comments

SongYg picture SongYg  路  3Comments

mrcheeky123 picture mrcheeky123  路  3Comments

aihysp picture aihysp  路  3Comments

robert-gomes picture robert-gomes  路  3Comments