My output format is 20220129054235.496380-300
I need to convert the value in bold to normal and find the difference of that to now() ie., epoch time. this will give the uptime in days
Hi
here is one way
| makeresults
| eval time="20220129054235.496380-300"
| eval epoch = strptime(time, "%Y%m%d%H%M%S.%6Q%z")
| eval time2 = strftime(epoch, "%F %T")
| eval UpTime = tostring(round(now()-epoch), "duration")
If you want to calculate with UpTime then you need to convert it by yourself as usually to get days, hours, mins and seconds from it.
r. Ismo
Hi
here is one way
| makeresults
| eval time="20220129054235.496380-300"
| eval epoch = strptime(time, "%Y%m%d%H%M%S.%6Q%z")
| eval time2 = strftime(epoch, "%F %T")
| eval UpTime = tostring(round(now()-epoch), "duration")
If you want to calculate with UpTime then you need to convert it by yourself as usually to get days, hours, mins and seconds from it.
r. Ismo