Table of dead instances

Hi,

I am using telegraf from 3 nodes to send data to influxdb2.
I have setup a deadman check called uptime which triggers to level crit for a host if it is down for more than 10 min.

I am trying to create a table of all the hosts that are off (in state crit) and ma using this query

from(bucket: "_monitoring")
  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
  |> filter(fn: (r) => r["_check_name"] == "uptime")
  |> last()
  |> filter(fn: (r) => r["_level"] == "crit")

However each line of output has its own table ID.

Any suggestions on how I can go about doing this or if there is some sort of template or other mechanism to achieve this would be very helpful.

Thanks,
Reshad

I am don’t know much about flux but as far as I know it should return different tables and you need to join them. Checkout flux docs and join function.

Hi @Mert,

Thanks for your reply. I had a look at flux joins and unions however I could not get either to work as they require the table ID/names to join on and those are not standard.
It looks like I need to union this data.

I have attached the CSV output of the query to this message.

Thanks,
Reshad

2020-06-02-17-52_chronograf_data.tar.gz (857 Bytes)