# Kibana Visualization - Gauge

**URL:** https://discuss.elastic.co/t/kibana-visualization-gauge/250037
**Category:** Kibana
**Created:** [September 26, 2020, 1:29am UTC](https://discuss.elastic.co/t/kibana-visualization-gauge/250037 "2020-09-26T01:29:22Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![rkarthik.kr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rkarthik.kr/32/49985_2.png) [@rkarthik.kr](https://discuss.elastic.co/u/rkarthik.kr)
#### Post date: [September 26, 2020, 1:29am UTC](https://discuss.elastic.co/t/kibana-visualization-gauge/250037/1 "2020-09-26T01:29:23Z")

</div>

Hello All

I am trying to build a visualization in Kibana using Gauge . Below is the data in my Index

```
App_Name Service_Name Run_Number Coverage
Red A 4 90      
Red B 4 70                   
Blue A 4 90
Blue C 4 90
Green A 4 90

Red A 3 80      
Red B 3 60                    
Blue A 3 70
Blue C 3 90
Green A 3 60

Red A 2 85            
Red B 2 45               
Blue A 2 75
Blue C 2 40
Green A 2 65

```

I want to display a gauge for each app and show the average of coverage for all services for the app for the latest Run\_number

```
Red Blue Green
80 90 90

```

Shows the average for each App for the recent run\_number = 4

Any thoughts on how I can set this up in Kibana Visualization . I am not able to filter dynamically based on the max run\_number .

Appreciate any help on this

Thanks  
Karthik

---

<div class="post-metadata">

### Author: ![rkarthik.kr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rkarthik.kr/32/49985_2.png) [@rkarthik.kr](https://discuss.elastic.co/u/rkarthik.kr)
#### Post date: [September 26, 2020, 6:46am UTC](https://discuss.elastic.co/t/kibana-visualization-gauge/250037/2 "2020-09-26T06:46:11Z")

</div>

@flash1293 & @dosant Any suggestions on this ? Appreciate any help on this

---

<div class="post-metadata">

### Author: ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)
#### Post date: [October 8, 2020, 6:20pm UTC](https://discuss.elastic.co/t/kibana-visualization-gauge/250037/3 "2020-10-08T18:20:36Z")

</div>

Hi, I would use a bucket aggregation to find the "latest" term of `Run_Number`, and get the average `Coverage` for that term. Overall, there will be a separate gauge per app by splitting by the terms of the `App_Name`

**Metrics** : Overall Max of Average of Coverage

- Aggregation: Max Bucket
- Bucket
  - Aggregation: Terms
  - Field: `Run_Number`
  - Order: Descending
  - Order by: Alphabetical
  - Size: 1

- Metric
  - Aggregation: Average
  - Field: `Coverage`

**Buckets** : Split group: `App_Name`

- Aggregation: Terms
- Field: `App_Name`

Explanation: The Max Bucket metric splits the data by Run\_Number, taking only one bucket/group that represents the highest value. That is due to sorting the buckets descending alphabetically and limiting the size of terms to 1.

For the single Run\_Number bucket, we're getting the average of the Coverage. We pull that value into the graph using "max bucket", but it doesn't matter what metric selector we use (max, min, whatever) because there is only a single group of Run\_Numbers.

That is how the average of coverage will show up in a gauge. We split the data into multiple gauges with the terms aggregation on App\_Name.

---

<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: [November 5, 2020, 6:20pm UTC](https://discuss.elastic.co/t/kibana-visualization-gauge/250037/4 "2020-11-05T18:20:53Z")

</div>

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