# Get the maximum and average values after Count

**URL:** <https://discuss.elastic.co/t/get-the-maximum-and-average-values-after-count/196765>\
**Category:** Kibana\
**Created:** [August 26, 2019, 12:16pm UTC](https://discuss.elastic.co/t/get-the-maximum-and-average-values-after-count/196765 "2019-08-26T12:16:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![peropero](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/peropero/32/53554_2.png) [@peropero](https://discuss.elastic.co/u/peropero)\
**Post date:** [August 26, 2019, 12:16pm UTC](https://discuss.elastic.co/t/get-the-maximum-and-average-values-after-count/196765/1 "2019-08-26T12:16:49Z")

</div>

## The following log is output.

## @timestamp status\_code 2019/08/25 20:00 200 2019/08/25 20:00 200 2019/08/25 20:00 200 2019/08/25 20:01 300 2019/08/25 20:02 400 ・ ・ ・ 08/26/2019 02:02 400

What I want to express in Kibana visualization is the maximum and average values of TPS.  
It was possible to express TPS by counting each status\_code.

 ![%E3%82%AD%E3%83%A3%E3%83%97%E3%83%81%E3%83%A3](https://us1.discourse-cdn.com/elastic/original/3X/b/f/bf6ec06b7d2f8b4fb42637ae4a1f3943b313a800.jpeg)

 ![%E3%82%AD%E3%83%A3%E3%83%97%E3%83%81%E3%83%A3_2](https://us1.discourse-cdn.com/elastic/original/3X/d/9/d944c41ec157596865a14d5a0c4c290fe192299c.jpeg)  
However, the maximum and average values per hour or day of this TPS cannot be expressed.

Is there any good way?

---

<div class="post-metadata">

**Author:** ![markov00](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/markov00/32/33316_2.png) [@markov00](https://discuss.elastic.co/u/markov00)\
**Post date:** [August 26, 2019, 12:49pm UTC](https://discuss.elastic.co/t/get-the-maximum-and-average-values-after-count/196765/2 "2019-08-26T12:49:43Z")

</div>

Hi,  
you can use Average aggregation on one series, and create another series (with the + button on the top right side of each series) with Max aggregation.  
Each of them should have the group by terms : status\_code as you already did.  
The only thing is to change the interval value to hours that will allow you to create one bucket per hour and the aggregation will be computed on that interval

---

<div class="post-metadata">

**Author:** ![peropero](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/peropero/32/53554_2.png) [@peropero](https://discuss.elastic.co/u/peropero)\
**Post date:** [August 27, 2019, 12:35am UTC](https://discuss.elastic.co/t/get-the-maximum-and-average-values-after-count/196765/3 "2019-08-27T00:35:52Z")

</div>

Hi,  
Can you tell me specifically with screenshots?

I'm sorry for the lack of information.  
Added screenshot above.  
In the first place, the expression of TPS is  
In panel options tab, set interval: 1m,  
The value counted in the Data tab is divided by 60.  
Using the value obtained by this,  
I want to express the maximum value every hour in the past 24 hours.  
I also want to express the average value every hour in 24 hours.

Or is it better to output this TPS as a table?  
Could you tell me the procedure in that case?

---

<div class="post-metadata">

**Author:** ![peropero](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/peropero/32/53554_2.png) [@peropero](https://discuss.elastic.co/u/peropero)\
**Post date:** [August 28, 2019, 3:13am UTC](https://discuss.elastic.co/t/get-the-maximum-and-average-values-after-count/196765/4 "2019-08-28T03:13:41Z")

</div>

Hi, @markov00

I tried it, but I feel something is different.  
I changed the interval to 1h and divided by 3600.  
Also, max and avg are grouped by “terms: status\_code” respectively, but the result is as attached.

## Just Count TPS

 ![Just%20Count%20TPS_1](https://us1.discourse-cdn.com/elastic/original/3X/f/c/fc6203431a55956b1dd0365612c2199517bca85a.jpeg)  
 ![Just%20Count%20TPS2](https://us1.discourse-cdn.com/elastic/original/3X/a/b/ab48a0851a8a372cd2e7e2dee8b02705533d9eb8.jpeg)  
 ![Just%20Count%20TPS3](https://us1.discourse-cdn.com/elastic/original/3X/3/9/395660bf5c37a789bbe770b9e89be907ab46be82.jpeg)

## AVG\_MAX of TPS Count

 ![AVG_MAX%20of%20TPS%20Count1](https://us1.discourse-cdn.com/elastic/original/3X/e/3/e36c9d79f0e3fccde1c7a0af75301fbbaf2e3b51.jpeg)  
 ![AVG_MAX%20of%20TPS%20Count2](https://us1.discourse-cdn.com/elastic/original/3X/c/b/cba934aec4b02ff6573d444bc81746696699ae89.jpeg)  
 ![AVG_MAX%20of%20TPS%20Count3](https://us1.discourse-cdn.com/elastic/original/3X/5/2/523927535cdc4d14bf84d895f2453e8e3902e6ae.jpeg)  
 ![AVG_MAX%20of%20TPS%20Count4](https://us1.discourse-cdn.com/elastic/original/3X/f/d/fd52b03f86bc6d1999be83e18d44b169097647ee.jpeg)

regards.

---

<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:** [September 25, 2019, 3:13am UTC](https://discuss.elastic.co/t/get-the-maximum-and-average-values-after-count/196765/5 "2019-09-25T03:13:45Z")

</div>

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