# Use case where a query that displays all rows which will have not had an update within 3 minutes as status=DOWN

**URL:** https://discuss.elastic.co/t/use-case-where-a-query-that-displays-all-rows-which-will-have-not-had-an-update-within-3-minutes-as-status-down/206434
**Category:** Kibana
**Tags:** elastic-stack-sql
**Created:** [November 4, 2019, 4:13pm UTC](https://discuss.elastic.co/t/use-case-where-a-query-that-displays-all-rows-which-will-have-not-had-an-update-within-3-minutes-as-status-down/206434 "2019-11-04T16:13:01Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![bkleynbok](https://avatars.discourse-cdn.com/v4/letter/b/d2c977/32.png) [@bkleynbok](https://discuss.elastic.co/u/bkleynbok)
#### Post date: [November 4, 2019, 4:13pm UTC](https://discuss.elastic.co/t/use-case-where-a-query-that-displays-all-rows-which-will-have-not-had-an-update-within-3-minutes-as-status-down/206434/1 "2019-11-04T16:13:01Z")

</div>

Hello,

I am using ELK Stack 7.3.2 and working on a use case where a query that displays all rows which will have not had an update within 3 minutes as status=DOWN.

I am using Canvas to visualize events from Kafka topic. Lets say I get a message like this:`{"processName":"SM1","processType":"serviceManager","status":"DOWN","update":"2h14m","hostname":"devvm20"}`  
and then within 3 minutes I would not get it.

In ES SQL I would be something like this but I am not able to get it work.

> ```
> filters
> | essql 
> query="SELECT processName, processType, hostname, \"@timestamp\" as Time FROM \"boris-index\" WHERE \"@timestamp\" < NOW() - INTERVAL 3 MINUTES AND \"@timestamp\" < TODAY()"
> | table
> | render
> 
> ```

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/9/2/92b789cc331e08a276f16047c41f863675e99a77.png)  
I would like to be able to show status=DOWN when I have not get an update within 3 minutes. Then it would be helpful to combine with another query which and able to show that row is now of status=UP

Please help me out.

---

<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: [November 18, 2019, 9:56pm UTC](https://discuss.elastic.co/t/use-case-where-a-query-that-displays-all-rows-which-will-have-not-had-an-update-within-3-minutes-as-status-down/206434/2 "2019-11-18T21:56:06Z")

</div>

Wouldn't it be easier to read when you display a count of documents received from each processName with a 3m interval for the bucket, so it should display 1 if up and 0 if it's down?

---

<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: [December 16, 2019, 9:56pm UTC](https://discuss.elastic.co/t/use-case-where-a-query-that-displays-all-rows-which-will-have-not-had-an-update-within-3-minutes-as-status-down/206434/3 "2019-12-16T21:56:06Z")

</div>

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