Elastic Query


(elas) #1

I have data of last 30 days.. I want avg count of every hour of past 30 days... how can get that data .


(Mark Walkom) #2

Use https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-aggregations-bucket-datehistogram-aggregation.html and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-aggregations-metrics-avg-aggregation.html


(elas) #3

Thank You Warkolm,

actually i have data of last 30 days

EX;01-01-2015 00:00:00 - 50
01-01-2015 01:00:00 - 15
02-01-2015 00:00:00 - 20
02-01-2015 01:00:00 - 10
--............ 30-01-2015-500

So hour(00:00:00) wise avg count is (50+20)/2=35
and 01:00:00 avg is (15+10)/2 = 12.5

i want the output in above format.

is it possible


(elas) #4

need some suggestions for above scenario.


(system) #5

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.