# Aggregating using ingest Node

**URL:** <https://discuss.elastic.co/t/aggregating-using-ingest-node/92304>\
**Category:** Elasticsearch\
**Created:** [July 7, 2017, 5:36pm UTC](https://discuss.elastic.co/t/aggregating-using-ingest-node/92304 "2017-07-07T17:36:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Novak478](https://avatars.discourse-cdn.com/v4/letter/n/5f8ce5/32.png) [@Novak478](https://discuss.elastic.co/u/Novak478)\
**Post date:** [July 7, 2017, 5:36pm UTC](https://discuss.elastic.co/t/aggregating-using-ingest-node/92304/1 "2017-07-07T17:36:46Z")

</div>

Hi all,

I was curious if it is possible to perform a "count/terms" aggregation in an ingest node/pipeline using a script processor, or if there is any plan to add in support for a processor like that in the future?

To clarify, we have a index that we send raw data to for later querying. However, we have been reading more into ingest nodes, and are curious if anyone has been able to perform the aggregations in an ingest node with a script processor that would allow for the count aggregations to be performed before the data is actually indexed.

Here is the query we used to collect and count term counts:

GET index-name/\_search?size=0  
{  
"aggs": {  
"QueryName": {  
"terms": {  
"script": "doc['FieldName'].values"  
}  
}  
}  
}

Thank you.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 7, 2017, 6:12pm UTC](https://discuss.elastic.co/t/aggregating-using-ingest-node/92304/2 "2017-07-07T18:12:35Z")

</div>

Like doing lookups in elasticsearch?

No it won't happen. See:

> <https://github.com/elastic/elasticsearch/pull/20340>

There is an elasticsearch logstash plugin but sadly it does not support adding aggs: [https://www.elastic.co/guide/en/logstash/5.4/plugins-filters-elasticsearch.html](https://www.elastic.co/guide/en/logstash/5.4/plugins-filters-elasticsearch.html)

---

<div class="post-metadata">

**Author:** ![Novak478](https://avatars.discourse-cdn.com/v4/letter/n/5f8ce5/32.png) [@Novak478](https://discuss.elastic.co/u/Novak478)\
**Post date:** [July 7, 2017, 7:34pm UTC](https://discuss.elastic.co/t/aggregating-using-ingest-node/92304/3 "2017-07-07T19:34:29Z")

</div>

David,

Thanks for the quick reply, and for the github link as well - appreciate the help!

---

<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 4, 2017, 7:35pm UTC](https://discuss.elastic.co/t/aggregating-using-ingest-node/92304/4 "2017-08-04T19:35:05Z")

</div>

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