# Kibana group by device number and AVG aggregation

**URL:** <https://discuss.elastic.co/t/kibana-group-by-device-number-and-avg-aggregation/89112>\
**Category:** Kibana\
**Created:** [June 12, 2017, 9:14pm UTC](https://discuss.elastic.co/t/kibana-group-by-device-number-and-avg-aggregation/89112 "2017-06-12T21:14:20Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![rpuserh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rpuserh/32/63367_2.png) [@rpuserh](https://discuss.elastic.co/u/rpuserh)\
**Post date:** [June 12, 2017, 9:14pm UTC](https://discuss.elastic.co/t/kibana-group-by-device-number-and-avg-aggregation/89112/1 "2017-06-12T21:14:20Z")

</div>

Hi,  
I have devices with unique number (dev\_num)  
They are sending me data (Number from sensor (sensor\_number)) this number from 0-100 number

So i Need  
Y axis : group devices by device number(dev\_num) and get AVG(sensor\_number) for every device. and then show count (I think this will be Aggregation count with Advanced JSON Input)  
X axis : Aggregation : terms ; Field : sensor\_number (This is clear )

So basically I need help on Y axis as I din't manage to make Y axis aggregate as I want.

Please help on this,

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Brandon\_Kobel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brandon_kobel/32/14829_2.png) [@Brandon\_Kobel](https://discuss.elastic.co/u/Brandon_Kobel)\
**Post date:** [June 13, 2017, 12:59pm UTC](https://discuss.elastic.co/t/kibana-group-by-device-number-and-avg-aggregation/89112/2 "2017-06-13T12:59:57Z")

</div>

Hey @rpuserh which version of Kibana are you using?

Version 5.4.0 of Kibana added quite a few new settings, including the ability to have multiple Y-Axis as discussed [here](https://www.elastic.co/blog/awesome-new-kibana-visualizations-heatmap-and-point-series) in "Point Series Charts" section.

Using the following chart configuration, I was able to create the following chart:

 ![](https://us1.discourse-cdn.com/elastic/original/3X/7/b/7b3a50dfdfb43df9ef6ab528e093d305339fb136.png)

 ![](https://us1.discourse-cdn.com/elastic/original/3X/8/5/85cf9d90049f61ed4319ce9e7afc08143dc9cf82.png) ![](https://us1.discourse-cdn.com/elastic/original/3X/2/a/2a7cd872f85072968f5312da020501e422474944.png)

---

<div class="post-metadata">

**Author:** ![rpuserh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rpuserh/32/63367_2.png) [@rpuserh](https://discuss.elastic.co/u/rpuserh)\
**Post date:** [June 13, 2017, 4:46pm UTC](https://discuss.elastic.co/t/kibana-group-by-device-number-and-avg-aggregation/89112/3 "2017-06-13T16:46:57Z")

</div>

Hi @Brandon_Kobel,  
Thank you for response  
Im running kibana 5.4.0  
I need only count on Y Axes

I need to group by dev\_num and calculate AVG number (That will be AVG(device sensor data) for every device )  
Then I want to show how many devices AVG sensor data 1 then 2 then 3 ...etc 100.

---

<div class="post-metadata">

**Author:** ![Brandon\_Kobel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brandon_kobel/32/14829_2.png) [@Brandon\_Kobel](https://discuss.elastic.co/u/Brandon_Kobel)\
**Post date:** [June 13, 2017, 6:18pm UTC](https://discuss.elastic.co/t/kibana-group-by-device-number-and-avg-aggregation/89112/4 "2017-06-13T18:18:31Z")

</div>

@rpuserh I'm having trouble following what you'd like the graph to look like, any chance you could mock-up what you're looking to build?

---

<div class="post-metadata">

**Author:** ![rpuserh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rpuserh/32/63367_2.png) [@rpuserh](https://discuss.elastic.co/u/rpuserh)\
**Post date:** [June 13, 2017, 6:50pm UTC](https://discuss.elastic.co/t/kibana-group-by-device-number-and-avg-aggregation/89112/5 "2017-06-13T18:50:12Z")

</div>

Thank you fore response @Brandon_Kobel  
I tried to explain it in this drawing

> **[Screen Shot 2017 06 13 at 11 44 26 AM](https://ibb.co/bswhoQ)**
>
> Image Screen Shot 2017 06 13 at 11 44 26 AM hosted in imgbb.com

---

<div class="post-metadata">

**Author:** ![Brandon\_Kobel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brandon_kobel/32/14829_2.png) [@Brandon\_Kobel](https://discuss.elastic.co/u/Brandon_Kobel)\
**Post date:** [June 13, 2017, 8:04pm UTC](https://discuss.elastic.co/t/kibana-group-by-device-number-and-avg-aggregation/89112/6 "2017-06-13T20:04:24Z")

</div>

@rpuserh this chart isn't something that Kibana can currently create, and this is a great opportunity for an Enhancement Request in our [GitHub repo](https://github.com/elastic/kibana/issues/new)

---

<div class="post-metadata">

**Author:** ![rpuserh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rpuserh/32/63367_2.png) [@rpuserh](https://discuss.elastic.co/u/rpuserh)\
**Post date:** [June 13, 2017, 8:33pm UTC](https://discuss.elastic.co/t/kibana-group-by-device-number-and-avg-aggregation/89112/7 "2017-06-13T20:33:45Z")

</div>

Thank you @Brandon_Kobel I will try there,

---

<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 11, 2017, 8:33pm UTC](https://discuss.elastic.co/t/kibana-group-by-device-number-and-avg-aggregation/89112/8 "2017-07-11T20:33:59Z")

</div>

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