Data aggregation using continuous queries


#1

I’m new to Influx db . We are ingesting data from Talend to influxdb and passing to grafana .

Can you throw some idea on how to create aggregated data metrics using continuous query

. For example
#Orders breaching SLA in last 1 hr/1day or 1 month
#Orders inserted into the system in last 1 hr/1day or 1 month


#2

Does this doc do what you need? It walks through how to downsample with your continuous queries.


#3

Hi Katy,

Thanks for your reply !!

However i have not got the expected result using the samples given in the doc


#4

show databases
name: databases
_internal
Testing
slamgmt
mydbdemo
food_data
use food_data
Using database food_data
show measurements
name: measurements
name


downsampled_orders
orderscq
ordersnew

select * from orderscq
name: orderscq
time phone websit


1539070565215754500 10 30
1539070575140554500 12 39
1539070592247154500 11 56

Show continuous queries

name: food_data
name query


cq_15m CREATE CONTINUOUS QUERY cq_15m ON food_data BEGIN SELECT mean(website) AS mean_website, mean(phone) AS mean_phone INTO food_data.a_year.downsampled_order
s FROM food_data.autogen.orderscq GROUP BY time(15m) END

cq_10m CREATE CONTINUOUS QUERY cq_10m ON food_data BEGIN SELECT mean(website) AS mean_website, mean(phone) AS mean_phone INTO food_data.a_year.downsampled_order
s FROM food_data.autogen.ordersnew GROUP BY time(10m) END

Select * from food_data.a_year.downsampled_orders
name: downsampled_orders
time mean_website


1539070200000000000 41.666666666666664
1539076200000000000 43

Issues in above continuous query is " I’m not able to find the mean_phone list on the new measurement

Let me know ur thoughts