# Post\_filter for aggregation?

**URL:** <https://discuss.elastic.co/t/post-filter-for-aggregation/35167>\
**Category:** Elasticsearch\
**Created:** [November 20, 2015, 4:26pm UTC](https://discuss.elastic.co/t/post-filter-for-aggregation/35167 "2015-11-20T16:26:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![davmrtl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davmrtl/32/3477_2.png) [@davmrtl](https://discuss.elastic.co/u/davmrtl)\
**Post date:** [November 20, 2015, 4:26pm UTC](https://discuss.elastic.co/t/post-filter-for-aggregation/35167/1 "2015-11-20T16:26:27Z")

</div>

Hi,

Is there a way to use a post filter in an aggregation?

The reason why I'm asking is that I use pipeline aggregation and need all result to do the processing but I don't need all of this data, simply the pipeline aggregation results.

At this moment, the response gives me 500 000 lines of JSON but I only need the pipeline aggregation results.

Is there a way to do that?

Thanks,

David

---

<div class="post-metadata">

**Author:** ![polyfractal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/polyfractal/32/48162_2.png) [@polyfractal](https://discuss.elastic.co/u/polyfractal)\
**Post date:** [November 20, 2015, 5:45pm UTC](https://discuss.elastic.co/t/post-filter-for-aggregation/35167/2 "2015-11-20T17:45:25Z")

</div>

You can use `filter_path` Response Filtering to trim down the response to just the bare essentials that you need: [https://www.elastic.co/guide/en/elasticsearch/reference/current/common-options.html#\_response\_filtering](https://www.elastic.co/guide/en/elasticsearch/reference/current/common-options.html#_response_filtering)

I've found the double star particularly handy when doing pipeline work. E.g.

```auto
GET /test/_search?filter_path=aggs.**.my_pipeline_name

```

---

<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, 11:36pm UTC](https://discuss.elastic.co/t/post-filter-for-aggregation/35167/3 "2017-07-05T23:36:51Z")

</div>


