Compare Logstash Old Event Against New One and Make Math Operation

Hello everyone,
I want to compare the time object in each row with the next date object and get the difference between them and print them on the screen. I tried Aggregate plugin, Elapsed plugin, but could not reach the solution I wanted. Can you give an example filter that I can provide with Ruby script?
Log :
00:04:00 Enter user2
14:12:44 Enter user1
15:13:44 Enter user2
16:18:44 Enter user1
17:58:44 Enter user2
19:58:44 Restart
00:01:27 Enter user1
13:22:44 Exit user1

Question :
Assume that
variable1 = 14:12:44
variable2 = 15:13:44
variable3 = 00:01:27
if (variable2 > variable1 )
print 15:13:44 - 14:12:44
else if (variable2 > variable3)
print dateVariable++

Could you give me a filter example that solves this ?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.