Is it possible to take the count of 2 queries in a certain timeframe, calculate what percentage the one is from the other (let’s say, total nr of requests and number of unsuccessful requests) and then alert on that percentage?.
So basically I take a timeperiod, let’s say 5 mins. I count the nr. of documents and I count a subset of that. Then the percentage this subset is of the total is calculated and I alert if this exceeds a certain treshold. Hope I make clear what I intent to.
Have been looking at the kibana with some sample data, but it feels rather limited, so I suppose I need some workaround on this (Am not very familiair with kibana/ELK internals yet)?
This seems to be more a generic Elasticsearch DSL question than an alerting question. But here is my take:
In your response you would like to have 2 buckets, one for total number of requests and one for failed requests. You can do this by using a terms aggregation query.
If you store response code as a keyword for example you could do this: