Difference between two time stamp
I want to find the difference between two time stamps (start and finish times) between two log entries, to display the time taken to complete a process and display it on the sumo dashboard. Can anyone please help with getting this difference using sumo query?
The timestamp is in this format(utc):
2021-02-10 11:33:54,698 +00:00 [53]
-
Hi Mita,
To get the difference between two timestamps, you need to convert them into milliseconds first and then subtract them
Something like below, you can choose the format as per your requirement, below is just and example.
| toMillis(parseDate(Start_time, "yyyy-MM-dd'T'HH:mm:ssZZZZ"))) as Start_time_milli
| itoMillis(parseDate(End_time, "yyyy-MM-dd'T'HH:mm:ssZZZZ"))) as End_time_milli
| (End_time_milli - Start_time_milli)/1000 as Duration_secRegards
Please sign in to leave a comment.
Comments
1 comment