Relevent telegraf.conf
[[inputs.mqtt_consumer]]
servers = ["tcp://localhost:1883"]
topics = ["sensors/#"]
data_format = "value"
data_type = "string"
[[inputs.mqtt_consumer.topic_parsing]]
topic = "sensors/+"
measurement = "measurement/_/"
tags = "_/sensor_id"
System info
Telegraf 1.21.0 rc0
Docker
No response
Steps to reproduce
See config above
Consider this case:
topic: sensors/0011
message: 45.0
I want Line Protocol like: sensors,sensor_id=0011 value=45.0
Pub to topic: sensors/0011 with message: 45.0
I would configure: measurement = "measurement/_" and tags = "_/sensor_id" and leave fields alone.
Expected behavior
Payloads may contain the necessary missing information for valid Line Protocol so there would be no need to address it in the topic. Or field information is just not required if the user is okay with a value=<value> type of field.
Actual behavior
The topic parsing configuration currently requires that measurement, tags, and fields params all be set and all underscores (i.e. _/_/_) does not circumvent this. A common use case for topic parsing is going to be to add the parsed information to an existing payload.
Additional info
No response
Relevent telegraf.conf
System info
Telegraf 1.21.0 rc0
Docker
No response
Steps to reproduce
See config above
Consider this case:
topic:
sensors/0011message:
45.0I want Line Protocol like:
sensors,sensor_id=0011 value=45.0Pub to topic:
sensors/0011with message:45.0I would configure:
measurement = "measurement/_"andtags = "_/sensor_id"and leave fields alone.Expected behavior
Payloads may contain the necessary missing information for valid Line Protocol so there would be no need to address it in the topic. Or field information is just not required if the user is okay with a
value=<value>type of field.Actual behavior
The topic parsing configuration currently requires that
measurement,tags, andfieldsparams all be set and all underscores (i.e._/_/_) does not circumvent this. A common use case for topic parsing is going to be to add the parsed information to an existing payload.Additional info
No response