# Calculate the average & standard deviation of the total events count

**URL:** <https://discuss.elastic.co/t/calculate-the-average-standard-deviation-of-the-total-events-count/189483>\
**Category:** Elasticsearch\
**Created:** [July 9, 2019, 8:29am UTC](https://discuss.elastic.co/t/calculate-the-average-standard-deviation-of-the-total-events-count/189483 "2019-07-09T08:29:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yagami23](https://avatars.discourse-cdn.com/v4/letter/y/e19adc/32.png) [@yagami23](https://discuss.elastic.co/u/yagami23)\
**Post date:** [July 9, 2019, 8:29am UTC](https://discuss.elastic.co/t/calculate-the-average-standard-deviation-of-the-total-events-count/189483/1 "2019-07-09T08:29:56Z")

</div>

we currently migrating Splunk to ELK, in Splunk we can calculate the average & standard deviation of the total events count by using query in Splunk :

earliest=-30d@d latest=@d | eval hour=strftime(\_time,"%H") | bin \_time span=d | stats count by \_time hour | stats avg(count) as Average stdev(count) as StdDev by hour

[https://docs.splunk.com/Documentation/Splunk/7.3.0/SearchReference/Stats](https://docs.splunk.com/Documentation/Splunk/7.3.0/SearchReference/Stats)

How can this be achieve by ELK in Discover ?

---

<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 6, 2019, 8:29am UTC](https://discuss.elastic.co/t/calculate-the-average-standard-deviation-of-the-total-events-count/189483/2 "2019-08-06T08:29:58Z")

</div>

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