# Latest value in a gauge

**URL:** https://discuss.elastic.co/t/latest-value-in-a-gauge/262659
**Category:** Kibana
**Created:** [January 29, 2021, 3:04pm UTC](https://discuss.elastic.co/t/latest-value-in-a-gauge/262659 "2021-01-29T15:04:42Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![luc.c](https://avatars.discourse-cdn.com/v4/letter/l/3e96dc/32.png) [@luc.c](https://discuss.elastic.co/u/luc.c)
#### Post date: [January 29, 2021, 3:04pm UTC](https://discuss.elastic.co/t/latest-value-in-a-gauge/262659/1 "2021-01-29T15:04:42Z")

</div>

Hi,  
I'm having trouble building a gauge based on two relevant fields: requestID and Status.  
My goal is to show the number of requestID for each status; it is not a cumulative count though, as the same requestID can assume different statuses during a period of time, so I need to consider just the latest one for each request. How can I consider just the latest statuses? is it correct to use @timestamp? (running on KIBANA 6.2.3).  
Thanks.

---

<div class="post-metadata">

### Author: ![wylie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wylie/32/81794_2.png) [@wylie](https://discuss.elastic.co/u/wylie)
#### Post date: [January 29, 2021, 7:18pm UTC](https://discuss.elastic.co/t/latest-value-in-a-gauge/262659/2 "2021-01-29T19:18:56Z")

</div>

Hi, welcome to the forums! Your version of Kibana is very old, but I think that my advice here is true for your older version as well.

You basically have two options here:

a. Change the data that you have stored in Elasticsearch, so that you represent only the latest status per requestID. If you do this you will be able to make the visualization you want using a Gauge.

b. Use Vega to create a fully custom visualization, where you will build an aggregation and then apply more aggregations in Vega. Vega was first introduced in Kibana 6.2, so you should have it. [Vega | Kibana Guide [master] | Elastic](https://www.elastic.co/guide/en/kibana/master/vega.html)

---

<div class="post-metadata">

### Author: ![luc.c](https://avatars.discourse-cdn.com/v4/letter/l/3e96dc/32.png) [@luc.c](https://discuss.elastic.co/u/luc.c)
#### Post date: [February 1, 2021, 9:05am UTC](https://discuss.elastic.co/t/latest-value-in-a-gauge/262659/3 "2021-02-01T09:05:46Z")

</div>

Hi,  
thanks for the reply.  
I think I will try the second option, but I have two question:

1. what's the format: {property: ""} for the gauge?
2. Can I use only the field @timestamp or also requestID?  
I don't know the Vega visualization.  
Thanks

---

<div class="post-metadata">

### Author: ![wylie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wylie/32/81794_2.png) [@wylie](https://discuss.elastic.co/u/wylie)
#### Post date: [February 1, 2021, 4:42pm UTC](https://discuss.elastic.co/t/latest-value-in-a-gauge/262659/4 "2021-02-01T16:42:03Z")

</div>

You can build a gauge-like visualization called a bullet chart using Vega-Lite, like [this example](https://vega.github.io/vega-lite/examples/facet_bullet.html). The `format: { property` piece of the Vega spec is extracting a specific path from the JSON response from elasticsearch. [It's documented here](https://vega.github.io/vega-lite/docs/data.html#json). You can use any elasticsearch query.

---

<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: [March 1, 2021, 4:42pm UTC](https://discuss.elastic.co/t/latest-value-in-a-gauge/262659/5 "2021-03-01T16:42:17Z")

</div>

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