Creating a simple "traffic light" indicator using timestamp for one of the revealed images

Hi,

I'm trying to create a standard traffic light in kibana canvas based on uptime of some applications.
I've been using the following query for showing a green and red square, but now I want to add a yellow square as well, which will be showing when the application is running, but have been down once (or more) the last three minutes.

Any ideas on where to start? I looked at this post: How do you create a simple "traffic light" indicator on a Canvas dashboard? but were not able to get anything out of it.

  query="select case when monitor.status = 'up' then 1 else 0 end as status
from \"myindex"
where monitor.id='first-monitor-status'
order by \"@timestamp\" desc
limit 1"
| math "status"
| revealImage origin="bottom" image={asset "asset-37fe96d7-c944-4ed4"} emptyImage={asset "asset-ba1fa979-af54-4219-a572"}
| render

Thanks in advance!

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