Alert on percentage

Hi,

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)?

THIA