# Average of new sample data each 10secs

**URL:** <https://discuss.elastic.co/t/average-of-new-sample-data-each-10secs/193371>\
**Category:** Kibana\
**Created:** [August 1, 2019, 3:53pm UTC](https://discuss.elastic.co/t/average-of-new-sample-data-each-10secs/193371 "2019-08-01T15:53:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![PiDel](https://avatars.discourse-cdn.com/v4/letter/p/e9c0ed/32.png) [@PiDel](https://discuss.elastic.co/u/PiDel)\
**Post date:** [August 1, 2019, 3:53pm UTC](https://discuss.elastic.co/t/average-of-new-sample-data-each-10secs/193371/1 "2019-08-01T15:53:50Z")

</div>

Hello,  
First thanks for your help. I do have the following question. I do have data incoming every 10 secondes as :

state  
name : srv1  
value : 30

state  
name : srv3  
value : 15

state  
name : srv2  
value : 20

I’ve used the top hit with size = 3, than the aggregate SUM. So far everything is fine.

However, If one server do not send anymore data (ex : srv1) I do have twice either srv3 or srv2 value leading to a false average.

Any idea how to by-pass this issue ?  
Dynamic size limit ? Enforce distinct values before top hit ?  
Thanks

---

<div class="post-metadata">

**Author:** ![nickpeihl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nickpeihl/32/112622_2.png) [@nickpeihl](https://discuss.elastic.co/u/nickpeihl)\
**Post date:** [August 22, 2019, 8:33pm UTC](https://discuss.elastic.co/t/average-of-new-sample-data-each-10secs/193371/2 "2019-08-22T20:33:18Z")

</div>

One way I would consider doing this is by bucketing the top hit aggregation by server in a data table visualization. Then you can add a total column that averages or sums the total value for all three servers. It does not enforce any constraint on having all three servers, but at least you would notice if one or more servers are missing.

 ![Screenshot_2019-08-22%20svr%20-%20Kibana](https://us1.discourse-cdn.com/elastic/original/3X/f/4/f452830d90a5c37f9d16380761e79dc8e871a62d.png)

---

<div class="post-metadata">

**Author:** ![PiDel](https://avatars.discourse-cdn.com/v4/letter/p/e9c0ed/32.png) [@PiDel](https://discuss.elastic.co/u/PiDel)\
**Post date:** [September 10, 2019, 3:40pm UTC](https://discuss.elastic.co/t/average-of-new-sample-data-each-10secs/193371/3 "2019-09-10T15:40:06Z")

</div>

Thanks for your answer !

---

<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:** [October 8, 2019, 3:40pm UTC](https://discuss.elastic.co/t/average-of-new-sample-data-each-10secs/193371/4 "2019-10-08T15:40:13Z")

</div>

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