We are collecting electrical data from sensors and storing into influxdb with telegraf as a collector. We are clubbing all the measurements in one. Some of the measurements are counter values and others are normal instantaneous data.
Sample Data Format
Reading,SensorId=Value MeasurementId=Value MeasurementId=Value timestamp Reading,SensorId=123123 2001=12345454 2002=45.56 1519209815
Where 2001, 2002 are the unique identifier of electrical parameters like kWH, kW etc.
Now we want to downsample the data to 15 mins using CONTINUOUS QUERY. The data is a mixture of counters and instantaneous parameter and for the downsampling different functions need to be applied based on the field_id. The parameter type we are storing in the Postgres whether it’s counter or instantaneous.
counter field_ids = derivative() instantaneous field_ids = mean()
So how to specify these condition in Continuous Query. What is the best way to achieve this?