# Query : GET average document count

**URL:** <https://discuss.elastic.co/t/query-get-average-document-count/306556>\
**Category:** Elasticsearch\
**Created:** [June 7, 2022, 11:19am UTC](https://discuss.elastic.co/t/query-get-average-document-count/306556 "2022-06-07T11:19:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![A\_j\_xx](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/a_j_xx/32/98491_2.png) [@A\_j\_xx](https://discuss.elastic.co/u/A_j_xx)\
**Post date:** [June 7, 2022, 11:19am UTC](https://discuss.elastic.co/t/query-get-average-document-count/306556/1 "2022-06-07T11:19:59Z")

</div>

Hi all ,

What would be the query to get average number of documents added per day on my index ?  
Is there any workaround or query to aggregate this data ?

Thanks !  
Hope to get a response

---

<div class="post-metadata">

**Author:** ![RabBit\_BR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rabbit_br/32/82261_2.png) [@RabBit\_BR](https://discuss.elastic.co/u/RabBit_BR)\
**Post date:** [June 7, 2022, 5:30pm UTC](https://discuss.elastic.co/t/query-get-average-document-count/306556/2 "2022-06-07T17:30:06Z")

</div>

Hi!  
The average doc per day, is that right? or would it be total doc per day?

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [June 8, 2022, 1:46am UTC](https://discuss.elastic.co/t/query-get-average-document-count/306556/3 "2022-06-08T01:46:41Z")

</div>

You can just go to Len's do a count on records x axis `@timestamp` and then under advanced do normalize by units one day and there you will have it a graph or table of your daily count of your records against an index.

If you want the daily average over an arbitrary time, I'll take a quick look. Probably do that in lens as well.

Example Here is a table in Lens

 ![Screen Shot 2022-06-07 at 8.04.23 PM](https://us1.discourse-cdn.com/elastic/original/3X/2/1/21076b101eb126bf3ab02db994472fd40788abb2.png)  
 ![Screen Shot 2022-06-07 at 8.04.29 PM](https://us1.discourse-cdn.com/elastic/original/3X/0/c/0c92dc41fb30ced5ed0ffec8bc8cfe2e8da1d37b.png)  
 ![Screen Shot 2022-06-07 at 8.05.52 PM](https://us1.discourse-cdn.com/elastic/original/3X/b/9/b9f8c454c040d533b81d54f3dbcd19affd2c2703.png)

---

<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, 1:47am UTC](https://discuss.elastic.co/t/query-get-average-document-count/306556/4 "2022-07-06T01:47:28Z")

</div>

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