MQTT to Inflix (mix of strings and floats) with Telegraf

My current MQTT topic looks like this:
mytopic/my_id/raw my_id>APZSKU,WIDE2-1:/291152z/0u!GT`GqO’![/A=049015/C=005/P=A2/est
mytopic/my_id/beacon/latitude 58.49990024309183
mytopic/my_id/beacon/longitude 24.540314916808
mytopic/my_id/beacon/speed 0.0
mytopic/my_id/beacon/course 24
mytopic/my_id/beacon/altitude 14939
mytopic/my_id/beacon/timestamp 1609242720
mytopic/my_id/beacon/climb 5.0
mytopic/my_id/beacon/phase A2
mytopic/my_id/event/ui_event Sens_ALL
mytopic/my_id/raw long_string
mytopic/my_id/report/temp_ext 19.75
mytopic/my_id/raw long_string
mytopic/my_id/report/temp_int 20.28
mytopic/my_id/report/humidity 31.42
mytopic/my_id/report/pressure 967.03
mytopic/my_id/report/temp_ext 19.81
mytopic/my_id/raw long_string
mytopic/my_id/beacon/latitude 58.509831305817926
mytopic/my_id/beacon/longitude 24.55033786089686
mytopic/my_id/beacon/speed 0.0
mytopic/my_id/beacon/course 28
mytopic/my_id/beacon/altitude 15240
mytopic/my_id/beacon/timestamp 1609242780
mytopic/my_id/beacon/climb 5.0
mytopic/my_id/beacon/phase A2

Currently Telegraf succesfully writes all the data points as strings into influx.
data_format = “value”
data_type = “string”
topics = [“mytopic/#”]

This will have some issues with Grafana in making meaninful queries and changing from string to what it is in reality. Having some issues with coordinates and Trackmap.

Is this the only and right way to proceed in your opinion?
Can I store maybe all “beacons” into a dedicated TABLE as well as the “report” and use speed, course as Column names instead?

Thanks a lot!

Take a look at the processor plugins in telegraf. Depending on the amount of changes you end up doing you might want to create a new bucket to test/experiment

I’am just wondering at this point if maybe would be quicker to write my own python code to do inserts into influx in the way I want them to be.?

Will have a look to the plugins …


I believe in being pragmatic. If you’re already familiar with python give it a try. Faster to the goal maybe more valuable than pure performance . If you do reach performance limits, then revisit the plugins. :+1: