Telegraf : Monitor webserver with http_response and query

Hi guys!
I’m new to Influxdb & Telegraf and I’m facing a “concept” issue (I think).
I’m trying to monitor a web server with the http_response input plugin.
So I have metrics with values :
“response_string_match”, “response_time”, “result_code”, “http_response_code”, “status_code”, “result_type”

For me, a response “failed” if the following : “status_code”!=‘200’ OR “result_code”!=0 OR “response_string_match”!=1
And it succeed if it doesn’t fail.

I’m trying to get a simple graph out of this measures, with 1 if it failed and 0 if it succeed.
The problem is that I have no idea how to write the query.
I tried something like that :

SELECT * FROM “telegraf”.“autogen”.“http_response” WHERE time > :dashboardTime: AND (“status_code”!=‘200’ OR “result_code”!=0 OR “response_string_match”!=1)

But obvisouly I only get the failing points.

I’m also looking to set an alert like :

If I don’t have any success for the past 5 minutes, trigger an alert handler. I know their is the “Deadman” option, but I can’t see how I can attach a “query” to it. Like, if this query returns no results for the past 5 minutes interval, trigger the handler.

I’m sorry if this is basic questions,

Many thanks

Vincent