I'm trying to calculate the mean time between recovery and the mean time between failure of some services monitored by heartbeat. For example, for MTBR, for each service I would like to get the time elapsed between two successive documents with the same monitor.id and having monitor.status down and up respectively. How can I do that?
p.s. I can also do further offline operations once I have obtained the data.