# Extended\_stats script in Grafana

**URL:** <https://discuss.elastic.co/t/extended-stats-script-in-grafana/146485>\
**Category:** Elasticsearch\
**Created:** [August 29, 2018, 8:05am UTC](https://discuss.elastic.co/t/extended-stats-script-in-grafana/146485 "2018-08-29T08:05:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aurimas](https://avatars.discourse-cdn.com/v4/letter/a/dc4da7/32.png) [@aurimas](https://discuss.elastic.co/u/aurimas)\
**Post date:** [August 29, 2018, 8:05am UTC](https://discuss.elastic.co/t/extended-stats-script-in-grafana/146485/1 "2018-08-29T08:05:08Z")

</div>

I would like to do math or if possible other aggregations on the outputs of extended\_stats in Grafana.  
My current goal is to divide doc count by 5. As I understand I should be able to do this by using scrip but I can not find any examples on extended\_stats scripting (documentation is quite wage).

It would be even better if I could do other aggregations on output of extended\_stats, like avg, min, max.

Is any of above possible is do how could I achieve it?

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/5/3/53e83664962a0fed712fb6a0c6c601838485bb50.png)

![image](https://us1.discourse-cdn.com/elastic/original/3X/1/c/1c1409d51a4d5702333a13c757dff7b6ffc19018.png)

---

<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:** [September 26, 2018, 8:05am UTC](https://discuss.elastic.co/t/extended-stats-script-in-grafana/146485/2 "2018-09-26T08:05:25Z")

</div>

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