Telegraf / Influxdb Parse Base 64 data payload

influxdb
telegraf
#1

I am bringing in sensor data from an MQTT feed into an InfluxDB which is working great - Thank you to the Telegraf Team!

My sensor data has within it a data field (which contains the temp, humidity, battery evel etc of the sensor). This value is imported as a base64 value. I am presently using NodeRed to decode and parse the data.

Does anyone know what my best course of action is on how to process that value - decode from base 64 and parse the payload into the various ‘useful’ values and store alongside the origional data.

Any help would be gratefully appreciated.

#2

Decoding the base64 values and storing them alongside their base64 cousins sounds like a made-to-order use case for a kapacitor script.

It’s also possible that you could edit the MQTT plugin in telegraf to to the decode and simultaneous write, but I think kapacitor would be the best route.

dg

#3

Thanks David, I havent played at all with Kapacitor but it sounds like that is about to change!

#4

If anyone knows of any useful tutorials or examples which would help me deliver this soltuion within kapacitor I woul dbe grateful.