I have several devices sending values to my mqtt broker every now and then. I would like to write a snapshot of the current values to influx every lets say 5 minutes.
The only usage experience that I have with Telegraf is to do regular metric scraping and sending to InfluxDB (see my example from last year). In your application, you want to summarize the data, then send it. I am guessing that there is a way to do this using Telegraf, but my first thoughts were to do one of the following approaches:
Send all the data points into InfluxDB and do your aggregation every 5 minutes using the last() function (something like |> aggregateWindow(every: 5m, fn: last, createEmpty: false) for each of your topics (dev1 and dev1).
Use Node-RED instead of Telegraf to do the summary (periodic state), then send that chunk of data to InfluxDB. Not sure if you have used Node-RED, but it’s pretty easy to get started with, it plays VERY nicely with MQTT and InfluxDB, and their forum is top notch for support.