I managed to solve it and I'll leave the solution here in case anyone needs it. As mentioned earlier, there is no way to create a loop, but we can create a range and use it to iterate Here's how I did it: --------------------- | eval i = mvrange(0,10) | mvexpand i ---------------------- <my search> | eval Time=_time | stats values(Time) as Time by UserName | eval i = mvrange(0,10) | mvexpand i | eval reconnection=if(UserName==UserName, tonumber(mvindex(Time,i+1))-tonumber(mvindex(Time,i)), "falha") | where reconnection>0 AND reconnection<600 | eval reconnection=tostring(reconnection, "duration")
... View more