# Possible to show average number of messages across unique IDs?

**URL:** <https://discuss.elastic.co/t/possible-to-show-average-number-of-messages-across-unique-ids/191636>\
**Category:** Kibana\
**Created:** [July 22, 2019, 12:32pm UTC](https://discuss.elastic.co/t/possible-to-show-average-number-of-messages-across-unique-ids/191636 "2019-07-22T12:32:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cgmelastic](https://avatars.discourse-cdn.com/v4/letter/c/b5ac83/32.png) [@cgmelastic](https://discuss.elastic.co/u/cgmelastic)\
**Post date:** [July 22, 2019, 12:32pm UTC](https://discuss.elastic.co/t/possible-to-show-average-number-of-messages-across-unique-ids/191636/1 "2019-07-22T12:32:20Z")

</div>

In our logging system, we have a unique ID tying together sets of operations, sort of like a "session" ID. I'm trying to show the average number of log messages per session. The closest I've gotten so far is using a sibling pipeline aggregation to show a data table with the count of messages bucketed by ID, then an average of those messages over time:  
 ![08%20AM](https://us1.discourse-cdn.com/elastic/original/3X/0/8/08f3729d1fb7a4b23bf6d7f4a1f917c7ee413e91.png)  
But this is not really useful to me. What I actually want is an average, across buckets, of that "Number of Messages" field. Is there a way to do this? I'm having trouble wrapping my head around it.

---

<div class="post-metadata">

**Author:** ![bhavyarm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bhavyarm/32/22392_2.png) [@bhavyarm](https://discuss.elastic.co/u/bhavyarm)\
**Post date:** [July 22, 2019, 5:42pm UTC](https://discuss.elastic.co/t/possible-to-show-average-number-of-messages-across-unique-ids/191636/2 "2019-07-22T17:42:07Z")

</div>

@markov00 can we please get some help here?

Thanks,  
Bhavya

---

<div class="post-metadata">

**Author:** ![cgmelastic](https://avatars.discourse-cdn.com/v4/letter/c/b5ac83/32.png) [@cgmelastic](https://discuss.elastic.co/u/cgmelastic)\
**Post date:** [July 24, 2019, 1:34pm UTC](https://discuss.elastic.co/t/possible-to-show-average-number-of-messages-across-unique-ids/191636/3 "2019-07-24T13:34:41Z")

</div>

Got it.  
In the `Options` tab, there's an option to "Show Total"  
 ![13%20AM](https://us1.discourse-cdn.com/elastic/original/3X/9/8/9844857a4080891acd2f8499f1194d283136dd22.png)  
One "Total function" is `avg`  
 ![17%20AM](https://us1.discourse-cdn.com/elastic/original/3X/9/9/9909ec35a9386e446119c5222594def7017b21ad.png)  
This puts the average across buckets at the bottom of the data table. There's no label or indication of how this number was calculated when you view it from the visualization or dashboard:  
 ![41%20AM](https://us1.discourse-cdn.com/elastic/original/3X/7/b/7b093c81fc6e11cd303abee75c9766082d3506b1.png)  
But at least I have this number somewhere and can see it now. I'd love to have it in a big, single-number, "Metric" visualization, but for now this is okay.

---

<div class="post-metadata">

**Author:** ![cgmelastic](https://avatars.discourse-cdn.com/v4/letter/c/b5ac83/32.png) [@cgmelastic](https://discuss.elastic.co/u/cgmelastic)\
**Post date:** [July 24, 2019, 2:42pm UTC](https://discuss.elastic.co/t/possible-to-show-average-number-of-messages-across-unique-ids/191636/4 "2019-07-24T14:42:15Z")

</div>

After a suggestion from a teammate today in standup, I've got that problem solved too 😁  
 ![15%20AM](https://us1.discourse-cdn.com/elastic/original/3X/e/9/e9b7421442f1ce52402a71a8aefd74584b111491.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:** [August 21, 2019, 2:42pm UTC](https://discuss.elastic.co/t/possible-to-show-average-number-of-messages-across-unique-ids/191636/5 "2019-08-21T14:42:19Z")

</div>

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