Modbus to Telegraf to InfluxDB


I’ve just started to use InfluxDB with telegraf. I have a modbus device that I’m trying to poll via telegraf. So far I’m able to poll data from the modbus device at an interval of 10s (set in the agent field of the config) and the data shows up in InfluxDB correctly.

What I’m curious is if it is possible to have telegraf monitor the modbus value every 2 seconds and only write to influxDB if there is a change of >50 in the value. Is this something that can be done? What is the best approach for this?


I think itnis possible, but why youwant to do it like that?. I poll every 2 from a bunch of Modbus Devices and besides the benefit of just having the data there is a lot of stuff that you can do with a “continuous” time series.

Worst case scenario you could do 2 buckets on InfluxDB, one as a buffer with a given lifespan, and then create a InfluxDB task that checks the databand then stores the reusult in the second bucket if the conditions are met.