# Exponential interval in histogram

**URL:** <https://discuss.elastic.co/t/exponential-interval-in-histogram/65436>\
**Category:** Elasticsearch\
**Created:** [November 9, 2016, 6:06am UTC](https://discuss.elastic.co/t/exponential-interval-in-histogram/65436 "2016-11-09T06:06:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![KaranPanchal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/karanpanchal/32/10477_2.png) [@KaranPanchal](https://discuss.elastic.co/u/KaranPanchal)\
**Post date:** [November 9, 2016, 6:06am UTC](https://discuss.elastic.co/t/exponential-interval-in-histogram/65436/1 "2016-11-09T06:06:44Z")

</div>

Query:  
GET data/\_search  
{  
"size": 0,  
"query": {  
"bool": {  
"filter": [  
{  
"term": {  
"type": "datatype1"  
}  
},  
{  
"exists": {  
"field": "SOME\_ID"  
}  
}  
]  
}  
},  
"aggs": {  
"group\_by\_state": {  
"terms": {  
"script": "doc['COLUMN1'].value/(2048\*(doc['COLUMN2'].value+doc['COLUMN3'].value))",  
"order": {  
"\_term": "asc"  
},  
"size":0  
},  
"aggs": {  
"group\_by\_field": {  
"terms": {  
"field": "any\_id",  
"order": {  
"\_term": "asc"  
},  
"size": 0  
}  
}  
}  
}  
}  
}

I want to use histogram so that I can use interval on 'group\_by\_state' in exponential form (e.g. 2^n (n=..,-3,-2,-1,0,1....)). How to achieve this kind of result by modifying above query?

One more question, is it possible to use log in interval e.g. 1log2?

Please reply ASAP!!

---

<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:** [December 7, 2016, 6:07am UTC](https://discuss.elastic.co/t/exponential-interval-in-histogram/65436/2 "2016-12-07T06:07:04Z")

</div>

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