# \[ Get the average number of an unique count \]

**URL:** <https://discuss.elastic.co/t/get-the-average-number-of-an-unique-count/52847>\
**Category:** Kibana\
**Created:** [June 15, 2016, 10:15am UTC](https://discuss.elastic.co/t/get-the-average-number-of-an-unique-count/52847 "2016-06-15T10:15:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jerome83136](https://avatars.discourse-cdn.com/v4/letter/j/db5fbb/32.png) [@jerome83136](https://discuss.elastic.co/u/jerome83136)\
**Post date:** [June 15, 2016, 10:15am UTC](https://discuss.elastic.co/t/get-the-average-number-of-an-unique-count/52847/1 "2016-06-15T10:15:57Z")

</div>

Hello,

I need some help for a query.

My documents are Apache access logs and they have a "jsessionid" field (string) and a JVM field (string).

I would like to get the average number of unique count of jsessionid per JVM for a given period; to display it on a line chart. So that I will have an indicator of the average number of sessions in my JVMs.

Could someone help me in building this query ? Maybe I need some scripted field ?

Thanks for your help  
Regards  
Jérôme

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [June 15, 2016, 10:08pm UTC](https://discuss.elastic.co/t/get-the-average-number-of-an-unique-count/52847/2 "2016-06-15T22:08:00Z")

</div>

I think you'd need pipeline aggs for this, to count each ID and then get the overall average.  
These aren't yet in KB though.

---

<div class="post-metadata">

**Author:** ![jerome83136](https://avatars.discourse-cdn.com/v4/letter/j/db5fbb/32.png) [@jerome83136](https://discuss.elastic.co/u/jerome83136)\
**Post date:** [June 16, 2016, 7:56am UTC](https://discuss.elastic.co/t/get-the-average-number-of-an-unique-count/52847/3 "2016-06-16T07:56:10Z")

</div>

Thank you for the answer.  
So I will try to find some examples of "pipeline aggs"

If someone has some information about that, or an idea about how to implement it for my use case; it would be nice to share 🙂

Best regards  
Jérôme

---

<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, 2017, 1:50pm UTC](https://discuss.elastic.co/t/get-the-average-number-of-an-unique-count/52847/4 "2017-07-06T13:50:22Z")

</div>


