# How to get \`count(\*)/sum(Duration)\` in elasticsearch(5.1.1) using curl?

**URL:** <https://discuss.elastic.co/t/how-to-get-count-sum-duration-in-elasticsearch-5-1-1-using-curl/74162>\
**Category:** Elasticsearch\
**Created:** [February 7, 2017, 6:22am UTC](https://discuss.elastic.co/t/how-to-get-count-sum-duration-in-elasticsearch-5-1-1-using-curl/74162 "2017-02-07T06:22:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![patil-akshay](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/patil-akshay/32/15295_2.png) [@patil-akshay](https://discuss.elastic.co/u/patil-akshay)\
**Post date:** [February 7, 2017, 6:22am UTC](https://discuss.elastic.co/t/how-to-get-count-sum-duration-in-elasticsearch-5-1-1-using-curl/74162/1 "2017-02-07T06:22:01Z")

</div>

I want to use two aggregates at a time my curl command should return the output based on this expression count(\*)/sum(Duration) how to do that.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [February 7, 2017, 6:33am UTC](https://discuss.elastic.co/t/how-to-get-count-sum-duration-in-elasticsearch-5-1-1-using-curl/74162/2 "2017-02-07T06:33:03Z")

</div>

Probably [https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-aggregations-pipeline-bucket-script-aggregation.html](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-aggregations-pipeline-bucket-script-aggregation.html)

---

<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:** [March 7, 2017, 6:33am UTC](https://discuss.elastic.co/t/how-to-get-count-sum-duration-in-elasticsearch-5-1-1-using-curl/74162/3 "2017-03-07T06:33:39Z")

</div>

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