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!

Detecting Remote Code Executions With the Splunk Threat Research Team

REGISTER NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If ...

Observability | Use Synthetic Monitoring for Website Metadata Verification

If you are on Splunk Observability Cloud, you may already have Synthetic Monitoringin your observability ...

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...