# Display a gauge from the time of the last received log

**URL:** <https://discuss.elastic.co/t/display-a-gauge-from-the-time-of-the-last-received-log/274088>\
**Category:** Kibana\
**Created:** [May 26, 2021, 3:21pm UTC](https://discuss.elastic.co/t/display-a-gauge-from-the-time-of-the-last-received-log/274088 "2021-05-26T15:21:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ATEADSGEO](https://avatars.discourse-cdn.com/v4/letter/a/bbe5ce/32.png) [@ATEADSGEO](https://discuss.elastic.co/u/ATEADSGEO)\
**Post date:** [May 26, 2021, 3:21pm UTC](https://discuss.elastic.co/t/display-a-gauge-from-the-time-of-the-last-received-log/274088/1 "2021-05-26T15:21:47Z")

</div>

Hello, I am begining in kibana/ELK.  
In a monitoring dashboard, I would like to display an 'alert' if the last received log is becoming old.  
The gauge seems to be adapted : green if last log is newer than 1 minute, then 2, and red if older than 3 minutes.  
How to build the data buckets to have the time between now to the last log received ?  
Thank you for your help

---

<div class="post-metadata">

**Author:** ![ATEADSGEO](https://avatars.discourse-cdn.com/v4/letter/a/bbe5ce/32.png) [@ATEADSGEO](https://discuss.elastic.co/u/ATEADSGEO)\
**Post date:** [June 11, 2021, 9:14am UTC](https://discuss.elastic.co/t/display-a-gauge-from-the-time-of-the-last-received-log/274088/2 "2021-06-11T09:14:22Z")

</div>

UP please

---

<div class="post-metadata">

**Author:** ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)\
**Post date:** [June 14, 2021, 2:59pm UTC](https://discuss.elastic.co/t/display-a-gauge-from-the-time-of-the-last-received-log/274088/3 "2021-06-14T14:59:26Z")

</div>

There are multiple ways of doing this.  
Easiest one is to use the Math aggregation in TSVB to do a diff between now and the timestamp of the last document.

Another one would be to use 2 color method, by setting the time picker in the top right to Last 1 minute and have a count of documents. If it's 0, make it red, if it's \>=1 keep it green.

Best one would be to just use alerting in order to get a notification if that happens. I suggest the index threshold type since it's perfectly suited for this use case.

> **[Index threshold | Kibana Guide \[7.x\] | Elastic](https://www.elastic.co/guide/en/kibana/7.x/rule-type-index-threshold.html)**

---

<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 12, 2021, 3:00pm UTC](https://discuss.elastic.co/t/display-a-gauge-from-the-time-of-the-last-received-log/274088/4 "2021-07-12T15:00:07Z")

</div>

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