Unable to fetch data

when i’m trying to run this query , i’m getting "NODATA " output.

SELECT mean(“usage_idle”) * -1 + 100 FROM “cpu” WHERE (“host” =~ /^$host$/) AND $timeFilter GROUP BY time($__interval), “host” fill(none)

when i’m trying to run query using below , i getting results

SELECT mean(“usage_idle”) * -1 + 100 FROM “cpu” WHERE (“host” =~ /^(it-103|it-1|nx|serevr19)$/) AND $timeFilter GROUP BY time(30s), “host” fill(none)

when i’m using $hosts in query ,getting NODATA output .But when using servers in place of $hosts getting results

please help me on this

1 Like

@ravitejachandika it sounds like you’re expecting the $hosts variable to be defined, but it is not.

Have you defined this as a custom variable using this method?

This variable wouldn’t normally be defined, so in order for this to work as expected, you should most likely define it according to the docs above.

Hope this helps!

i defined the host variables also , even though its showing NO DATA .
And also after creating alerts the rule_uid is not creating .

please help me on this .