# Group by hour aggregation using date-histogram on multiple days?

**URL:** https://discuss.elastic.co/t/group-by-hour-aggregation-using-date-histogram-on-multiple-days/35710
**Category:** Elasticsearch
**Created:** [November 27, 2015, 7:09am UTC](https://discuss.elastic.co/t/group-by-hour-aggregation-using-date-histogram-on-multiple-days/35710 "2015-11-27T07:09:44Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![nunnavinay](https://avatars.discourse-cdn.com/v4/letter/n/f19dbf/32.png) [@nunnavinay](https://discuss.elastic.co/u/nunnavinay)
#### Post date: [November 27, 2015, 7:09am UTC](https://discuss.elastic.co/t/group-by-hour-aggregation-using-date-histogram-on-multiple-days/35710/1 "2015-11-27T07:09:44Z")

</div>

Hi ,  
I require a group by hour using the date-histogram aggregation,  
On a single day the results are as expected, which are displaying unique entity of hour.  
But for multiple days , there are multiple entries of hour, my requirement is to get single hour grouped on multiple days.

My current query is as below:  
GET index/xxxx/\_search  
{  
"size": 0,  
"aggs": {  
"hour": {  
"date\_histogram": {  
"field": "date",  
"interval": "hour",  
"min\_doc\_count": 0,  
"format": "hh"  
}  
}  
}  
}

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 5, 2017, 11:35pm UTC](https://discuss.elastic.co/t/group-by-hour-aggregation-using-date-histogram-on-multiple-days/35710/2 "2017-07-05T23:35:25Z")

</div>


