How to use timestamp as metric from my data and use it as filter?

Hi,

I have a time as a measurement but I can not use them as a metric filter to get the required value based on time. In my case I need to automatically need to find a number of counts based on difference in time relatives 3 to 5 minutes from previous to current time then I must make that as a seperate index count for my data ? Does someone know if so please provide me a support. In picture you can see the change in time different from 11 to 18.

image