# Pipeline aggregation - combining multiple buckets

**URL:** <https://discuss.elastic.co/t/pipeline-aggregation-combining-multiple-buckets/51124>\
**Category:** Elasticsearch\
**Created:** [May 27, 2016, 7:51am UTC](https://discuss.elastic.co/t/pipeline-aggregation-combining-multiple-buckets/51124 "2016-05-27T07:51:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![JozoVilcek](https://avatars.discourse-cdn.com/v4/letter/j/bc79bd/32.png) [@JozoVilcek](https://discuss.elastic.co/u/JozoVilcek)\
**Post date:** [May 27, 2016, 7:51am UTC](https://discuss.elastic.co/t/pipeline-aggregation-combining-multiple-buckets/51124/1 "2016-05-27T07:51:07Z")

</div>

Not sure if I got a title right, but this is what I want to do. E.g., let's say I am collecting disk usage metrics. Documents in elasticsearch have fields [@timestamp, cluster, disk, host, value]. Value is number of bytes used on a disk at given timestamp.

Now, as host have multiple disks and I am interested in total disk usage per host. The disk usage value is a gauge. Therefore I need to do a MAX agg over date histogram and then SUM all disks for cluster+host term bucket.

I am failing to figure out an aggregation for this. How this can be done with elasticseach?

---

<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, 10:48pm UTC](https://discuss.elastic.co/t/pipeline-aggregation-combining-multiple-buckets/51124/2 "2017-07-05T22:48:35Z")

</div>


