Get records only if condition persist for given span of time

I'm facing a querying problem with Kibana: I want to be returned all the records that match a given condition but only if they match it for at least a given span of time. Something like:

Clock > 50 and Vents is "off" ***for 20s minimum*** 

is it possible to make such a query in Kibana?