# ES input : ingest aggregation result

**URL:** <https://discuss.elastic.co/t/es-input-ingest-aggregation-result/96140>\
**Category:** Logstash\
**Created:** [August 7, 2017, 5:07pm UTC](https://discuss.elastic.co/t/es-input-ingest-aggregation-result/96140 "2017-08-07T17:07:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![smcooper](https://avatars.discourse-cdn.com/v4/letter/s/ba9def/32.png) [@smcooper](https://discuss.elastic.co/u/smcooper)\
**Post date:** [August 7, 2017, 5:07pm UTC](https://discuss.elastic.co/t/es-input-ingest-aggregation-result/96140/1 "2017-08-07T17:07:03Z")

</div>

Hi,

I would like to create an Elasticsearch index containing the result of an aggregation (some statistics), and not the documents of the source index.  
I get the expected result from Elasticsearch by including "size":0 in my query, but I can't manage to have logstash ingesting this result through the ES input.  
When I define the "size =\> 0" in the ES input, the query results (stats) aren't indexed at all (more exactly I get nothing out of it, including with stdout{ codec =\> rubydebug }). If size is positive the hits are indexed.

Could anybody tell me if/how I can index the aggregation result?  
Thanks,

Steph

```
input {
  elasticsearch {
        ...
        index => "logstash-index*" 
        size => 0 
        query => '{ "size":0, "aggs": {"... "}}' 
}
```

---

<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 4, 2017, 5:07pm UTC](https://discuss.elastic.co/t/es-input-ingest-aggregation-result/96140/2 "2017-09-04T17:07:35Z")

</div>

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