# Need one or last one as output from elastic search bucket aggregation

**URL:** <https://discuss.elastic.co/t/need-one-or-last-one-as-output-from-elastic-search-bucket-aggregation/93402>\
**Category:** Elasticsearch\
**Created:** [July 17, 2017, 1:33pm UTC](https://discuss.elastic.co/t/need-one-or-last-one-as-output-from-elastic-search-bucket-aggregation/93402 "2017-07-17T13:33:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![saidesh\_kilaru](https://avatars.discourse-cdn.com/v4/letter/s/9de0a6/32.png) [@saidesh\_kilaru](https://discuss.elastic.co/u/saidesh_kilaru)\
**Post date:** [July 17, 2017, 1:33pm UTC](https://discuss.elastic.co/t/need-one-or-last-one-as-output-from-elastic-search-bucket-aggregation/93402/1 "2017-07-17T13:33:34Z")

</div>

Hi Friends  
I am new to Elastic search.

In this page we are getting sum of all records  
[https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-pipeline-sum-bucket-aggregation.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-pipeline-sum-bucket-aggregation.html)

here it displays all time intervals data and sum also.. it is good. but is there anyway to get only one json as output or i need only last time interval record only displayed instead of each time interval record (no need sum) please help me.

---

<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:** [August 14, 2017, 1:34pm UTC](https://discuss.elastic.co/t/need-one-or-last-one-as-output-from-elastic-search-bucket-aggregation/93402/2 "2017-08-14T13:34:11Z")

</div>

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