# Elasticsearch input plugin used to \_count documents. Is it possible?

**URL:** <https://discuss.elastic.co/t/elasticsearch-input-plugin-used-to-count-documents-is-it-possible/306682>\
**Category:** Logstash\
**Created:** [June 8, 2022, 10:46am UTC](https://discuss.elastic.co/t/elasticsearch-input-plugin-used-to-count-documents-is-it-possible/306682 "2022-06-08T10:46:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rschirin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rschirin/32/45283_2.png) [@rschirin](https://discuss.elastic.co/u/rschirin)\
**Post date:** [June 8, 2022, 10:46am UTC](https://discuss.elastic.co/t/elasticsearch-input-plugin-used-to-count-documents-is-it-possible/306682/1 "2022-06-08T10:46:44Z")

</div>

Hey there,  
I was trying to use the `Elasticsearch` input plugin just to count documents in a specific timerange or to count the specific `_type` documents or so on, but I saw that I cannot use the `_count` method and I saw also that if I use a standard query and try to get the `hits.total` field value I cannot do that. is it correct?  
Is there any way to get what I was looking for? I need to get something that I could name "count metrics" and then store them into another output plugin (file or bigquery).  
Is Elasticsearch input plugin designed just for extract documents and nothing else (aggregations....)?

---

<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 6, 2022, 10:46am UTC](https://discuss.elastic.co/t/elasticsearch-input-plugin-used-to-count-documents-is-it-possible/306682/2 "2022-07-06T10:46:47Z")

</div>

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