All Apps and Add-ons

Cisco ASA Report-Duration in Minutes and not seconds

mgs2012
New Member

I'm trying to get a report out of my Cisco ASA VPN device using the following search report

source=*.log | xmlkv | stats first(Calling-Station-Id) as Calling-Station-Id, first(NAS-IP-Address) as NetworkDeviceName,first(User-Name) as User-Name,last(_time) as Starttime,first(_time) as Endtime,first(Acct-Session-Time) as "DURATION: in-seconds" by Acct-Session-Id |
eval Starttime=strftime(Starttime,"%+") |
eval Endtime=strftime(Endtime,"%+") |
table User-Name Starttime Endtime "DURATION: in-seconds" Calling-Station-Id

What I would like to achieve is to get the duration time in minutes. Does anybody know how to do this?

Please let me know.
Thanks in advance

0 Karma

joshbronko
New Member

This will work for what your trying to do. I converted the output duration to Hours:Minutes:Seconds

source=*.log | xmlkv | stats first(Calling-Station-Id) as Calling-Station-Id, first(NAS-IP-Address) as NetworkDeviceName,first(User-Name) as User-Name,last(_time) as Starttime,first(_time) as Endtime,first(Acct-Session-Time) as DURATION by Acct-Session-Id |
eval Starttime=strftime(Starttime,"%+") |
eval Endtime=strftime(Endtime,"%+") | eval h=floor(DURATION/3600) | eval m=floor((DURATION-(h*3600))/60) | eval s=floor(DURATION-(h*3600)-(m*60)) | eval SessionDuration =h." Hours ".m." Minutes ".s." Seconds" |
table User-Name Starttime Endtime SessionDuration Calling-Station-Id

Works when I email the command. Does not work when i upload it to this post

0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...