# Using Transform for document count when document updated

**URL:** <https://discuss.elastic.co/t/using-transform-for-document-count-when-document-updated/364924>\
**Category:** Elasticsearch\
**Tags:** transforms\
**Created:** [August 14, 2024, 5:31pm UTC](https://discuss.elastic.co/t/using-transform-for-document-count-when-document-updated/364924 "2024-08-14T17:31:03Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Derek.X](https://avatars.discourse-cdn.com/v4/letter/d/ce73a5/32.png) [@Derek.X](https://discuss.elastic.co/u/Derek.X)\
**Post date:** [August 27, 2024, 2:44pm UTC](https://discuss.elastic.co/t/using-transform-for-document-count-when-document-updated/364924/4 "2024-08-27T14:44:02Z")

</div>

Checked multiple other potential solutions, I am trying to exporter the aggregation data to some other data storage.

Logstash elasticsearch input plugin seems to be an alternative. Sadly plugin version we are using does no support it.

> <https://github.com/logstash-plugins/logstash-input-elasticsearch/pull/197>
>
> As title says, this PR enables this plugin to execute aggregation queries
> 
> The… work is based on the existing PR #90 (and potentially resolves #58)
> However code & tests were updated to include all the changes that were introduced since original PR was created/last updated
> 
> Tests are included and also was live tested with Logstash v8.8.2

Watcher seems to be another alternative. Below is a thread about it

> [@Watcher condition with aggregation](https://discuss.elastic.co/t/watcher-condition-with-aggregation/225758/5):
>
> Hi @cjcenizal. Could you provide any feedback on my results? slight_smile Also, would array compare be applicable here? "condition": { "array\_compare": { "ctx.payload.aggregations.node\_name.buckets" : { "path": "unsure which path leads to unack\_count.value", "gte": { "value": 0 } } } }

---

_[View the full topic](https://discuss.elastic.co/t/using-transform-for-document-count-when-document-updated/364924)._
