base search | spath "body.totalTime" | search "body.totalTime"=426287
How to convert milliseconds to minutes or seconds?
Like this:
base search
| spath "body.totalTime"
| search "body.totalTime"=426287
| fieldformat "body.totalTime" = round(('body.totalTime' / 1000), 3)
Like this:
base search
| spath "body.totalTime"
| search "body.totalTime"=426287
| fieldformat "body.totalTime" = round(('body.totalTime' / 1000), 3)
Hi
Try this
....| eval inSeconds = round('body.totalTime' / 1000,2)
| eval output = tostring(inSeconds, "duration")
Like this:
base search
| spath "body.totalTime"
| search "body.totalTime"=426287
| fieldformat "body.totalTime" = tostring('body.totalTime' / 1000, "duration")
@woodcock ck :Tried this one
base search | search "body.totalTime"=82534 | fieldformat "body.totalTime" = tostring('body.totalTime' / 1000, "duration") | table body.totalTime
Result I am getting like this 00:01:22.534000000000006 instead of 82.534 sec
I was giving you what I thought was a "better" answer. See my new answer for the "exact" answer to what you asked.
try this
base search|spath "body.totalTime" | eval body.seconds=body.totalTime*1000 | eval body.minutes=body.seconds*60
|table body.totalTime, body.seconds, body.minutes