<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to calculate the total vpn connection time per user? in Reporting</title>
    <link>https://community.splunk.com/t5/Reporting/How-to-calculate-the-total-vpn-connection-time-per-user/m-p/510810#M8274</link>
    <description>&lt;P&gt;I see, that's VPN.&lt;/P&gt;</description>
    <pubDate>Fri, 24 Jul 2020 09:13:01 GMT</pubDate>
    <dc:creator>to4kawa</dc:creator>
    <dc:date>2020-07-24T09:13:01Z</dc:date>
    <item>
      <title>How to calculate the total vpn connection time per user?</title>
      <link>https://community.splunk.com/t5/Reporting/How-to-calculate-the-total-vpn-connection-time-per-user/m-p/508550#M8201</link>
      <description>&lt;P&gt;&lt;SPAN class="t"&gt;Hi All!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Can anyone help with these questions below?&lt;BR /&gt;How to calculate the total vpn connection time per user?&lt;BR /&gt;The Duration field is of type string.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="t"&gt;"Jul&lt;/SPAN&gt; &lt;SPAN class="t"&gt;10&lt;/SPAN&gt; &lt;SPAN class="t"&gt;07:14:17&lt;/SPAN&gt; xxx&lt;SPAN class="t"&gt;.xxx.xxx.xx&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN class="t"&gt;%ASA-4-113019:&lt;/SPAN&gt; &lt;SPAN class="t"&gt;Group&lt;/SPAN&gt; &lt;SPAN class="t"&gt;=&lt;/SPAN&gt; &lt;SPAN class="t"&gt;XYZ-SSL&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;SPAN class="t"&gt;Username &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="t"&gt;=&lt;/SPAN&gt; zya3&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN class="t"&gt;IP&lt;/SPAN&gt; &lt;SPAN class="t"&gt;=&lt;/SPAN&gt;&amp;nbsp;xxx&lt;SPAN class="t"&gt;.xxx.xxx.xx&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN class="t"&gt;Session&lt;/SPAN&gt; &lt;SPAN class="t"&gt;disconnected.&lt;/SPAN&gt; &lt;SPAN class="t"&gt;Session&lt;/SPAN&gt; &lt;SPAN class="t"&gt;Type:&lt;/SPAN&gt; &lt;SPAN class="t"&gt;AnyConnect-Parent&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN class="t"&gt;Duration:&lt;/SPAN&gt; &lt;SPAN class="t"&gt;0h:41m:42s&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN class="t"&gt;Bytes&lt;/SPAN&gt; &lt;SPAN class="t"&gt;xmt:&lt;/SPAN&gt; &lt;SPAN class="t"&gt;27921408&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN class="t"&gt;Bytes&lt;/SPAN&gt; &lt;SPAN class="t"&gt;rcv:&lt;/SPAN&gt; &lt;SPAN class="t"&gt;4612882&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN class="t"&gt;Reason:&lt;/SPAN&gt; &lt;SPAN class="t"&gt;User&lt;/SPAN&gt; &lt;SPAN class="t"&gt;Requested&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="t"&gt;Jul 9 23:55:49 xxx.xxx.xxx.xx&amp;nbsp;%ASA-4-113019: Group = XYZ-SSL&lt;SPAN&gt;, &lt;/SPAN&gt;Username = zya3&lt;SPAN&gt;, &lt;/SPAN&gt;IP = xxx.xxx.xxx.xx&lt;SPAN&gt;, &lt;/SPAN&gt;Session disconnected. Session Type: SSL&lt;SPAN&gt;, &lt;/SPAN&gt;Duration: 0h:11m:46s&lt;SPAN&gt;, &lt;/SPAN&gt;Bytes xmt: 13452434&lt;SPAN&gt;, &lt;/SPAN&gt;Bytes rcv: 5072740&lt;SPAN&gt;, &lt;/SPAN&gt;Reason: User Requested&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="t"&gt;Jul 9 21:36:12 xxx.xxx.xxx.xx&amp;nbsp;%ASA-4-113019: Group = XYZ-SSL&lt;SPAN&gt;, &lt;/SPAN&gt;Username = zzw2&lt;SPAN&gt;, &lt;/SPAN&gt;IP = xxx.xxx.xxx.xx&lt;SPAN&gt;, &lt;/SPAN&gt;Session disconnected. Session Type: SSL&lt;SPAN&gt;, &lt;/SPAN&gt;Duration: 14h:38m:38s&lt;SPAN&gt;, &lt;/SPAN&gt;Bytes xmt: 487160561&lt;SPAN&gt;, &lt;/SPAN&gt;Bytes rcv: 39385026&lt;SPAN&gt;, &lt;/SPAN&gt;Reason: User Requested"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="t"&gt;- Through the eval command you can concatenate the corresponding fields of the numeric type.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="t"&gt;| transaction user endswith="duration:" keepevicted=true&lt;/SPAN&gt;&lt;SPAN class="t"&gt;| eval full_duration = duration_hour.":".duration_minute.":".duration_second&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="t"&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/1406"&gt;@woodcock&lt;/a&gt;&amp;nbsp;you are the man"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="t"&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 22:07:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/How-to-calculate-the-total-vpn-connection-time-per-user/m-p/508550#M8201</guid>
      <dc:creator>jfeitosa_real</dc:creator>
      <dc:date>2020-07-10T22:07:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the total vpn connection time per user?</title>
      <link>https://community.splunk.com/t5/Reporting/How-to-calculate-the-total-vpn-connection-time-per-user/m-p/508558#M8202</link>
      <description>&lt;LI-CODE lang="markup"&gt;| makeresults
| eval _raw="Jul 10 07:14:17 xxx.xxx.xxx.xx %ASA-4-113019: Group = XYZ-SSL, Username = zya3, IP = xxx.xxx.xxx.xx, Session disconnected. Session Type: AnyConnect-Parent, Duration: 0h:41m:42s, Bytes xmt: 27921408, Bytes rcv: 4612882, Reason: User Requested

Jul 9 23:55:49 xxx.xxx.xxx.xx %ASA-4-113019: Group = XYZ-SSL, Username = zya3, IP = xxx.xxx.xxx.xx, Session disconnected. Session Type: SSL, Duration: 0h:11m:46s, Bytes xmt: 13452434, Bytes rcv: 5072740, Reason: User Requested

Jul 9 21:36:12 xxx.xxx.xxx.xx %ASA-4-113019: Group = XYZ-SSL, Username = zzw2, IP = xxx.xxx.xxx.xx, Session disconnected. Session Type: SSL, Duration: 14h:38m:38s, Bytes xmt: 487160561, Bytes rcv: 39385026, Reason: User Requested"
| multikv noheader=t
| table _raw
| kv
| rex "(?&amp;lt;date&amp;gt;\w+ \d+ \S+)"
| rex "(?&amp;lt;status&amp;gt;Session \w+)\. Session Type: (?&amp;lt;type&amp;gt;\S+), Duration: (?&amp;lt;duration&amp;gt;\S+),"
| rex field=duration "(?&amp;lt;hours&amp;gt;\d*)h:(?&amp;lt;minutes&amp;gt;\d*)m:(?&amp;lt;seconds&amp;gt;\d*)s"
| eval _time=strptime(date,"%b %d %T")
| eval duration_sec=hours * 60 * 60 + minutes * 60 + seconds
| eventstats sum(duration_sec) as total_duration by Username&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 10 Jul 2020 22:56:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/How-to-calculate-the-total-vpn-connection-time-per-user/m-p/508558#M8202</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-07-10T22:56:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the total vpn connection time per user?</title>
      <link>https://community.splunk.com/t5/Reporting/How-to-calculate-the-total-vpn-connection-time-per-user/m-p/508863#M8227</link>
      <description>&lt;P&gt;Hi, &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/184221"&gt;@to4kawa&lt;/a&gt;, thanks for your response.&lt;/P&gt;&lt;P&gt;But how to calculate the total time per user of the duration field, since this is a string type? For example, if in two events of the same user, the duration field has the values (0h: 47m: 42s and 0h: 18m: 46s) that total time would be (01h: 06m: 28s). It would be possible?&lt;/P&gt;&lt;P&gt;Thx.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jul 2020 18:12:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/How-to-calculate-the-total-vpn-connection-time-per-user/m-p/508863#M8227</guid>
      <dc:creator>jfeitosa_real</dc:creator>
      <dc:date>2020-07-13T18:12:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the total vpn connection time per user?</title>
      <link>https://community.splunk.com/t5/Reporting/How-to-calculate-the-total-vpn-connection-time-per-user/m-p/509138#M8230</link>
      <description>&lt;P&gt;try following &lt;STRONG&gt;REX&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jul 2020 20:56:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/How-to-calculate-the-total-vpn-connection-time-per-user/m-p/509138#M8230</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-07-14T20:56:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the total vpn connection time per user?</title>
      <link>https://community.splunk.com/t5/Reporting/How-to-calculate-the-total-vpn-connection-time-per-user/m-p/510803#M8273</link>
      <description>&lt;P&gt;&lt;SPAN&gt;A VPN just moves all your traffic through an encrypted tunnel to a different network...&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jul 2020 08:09:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/How-to-calculate-the-total-vpn-connection-time-per-user/m-p/510803#M8273</guid>
      <dc:creator>marshalb</dc:creator>
      <dc:date>2020-07-24T08:09:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the total vpn connection time per user?</title>
      <link>https://community.splunk.com/t5/Reporting/How-to-calculate-the-total-vpn-connection-time-per-user/m-p/510810#M8274</link>
      <description>&lt;P&gt;I see, that's VPN.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jul 2020 09:13:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/How-to-calculate-the-total-vpn-connection-time-per-user/m-p/510810#M8274</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-07-24T09:13:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the total vpn connection time per user?</title>
      <link>https://community.splunk.com/t5/Reporting/How-to-calculate-the-total-vpn-connection-time-per-user/m-p/511107#M8281</link>
      <description>&lt;P&gt;Hello @&lt;A href="https://community.splunk.com/t5/user/viewprofilepage/user-id/184221" target="_self"&gt;&lt;SPAN class=""&gt;to4kawa&lt;/SPAN&gt;&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;I decided to do it just by calculating the total in seconds.&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;index=vpn eventtype=cisco_vpn_end Username=* Group="*" &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;| fillnull value=0 duration_day&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;| multikv noheader=t &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;| eval total_duration=duration_day * (86400) + duration_hour * 60 * 60 + duration_minute * 60 + duration_second &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;| stats sum(total_duration) as Total_duration by Username Group &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;| eventstats sum(total_duration) as Total_duration by Username duration_day duration_hour duration_minute duration_second &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;| sort - Total_duration&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;So I did another research with more details of the navigation, making a statistic by the time and user.&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;index=vpn (eventtype=cisco_vpn_start OR eventtype=cisco_vpn_end) user=*&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;| transaction user endswith="duration:" keepevicted=true &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;| fillnull value=0 duration_day&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;| eval full_duration = duration_day."d-" .duration_hour.":" .duration_minute.":".duration_second&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;| eval bytesMB=round(((bytes/1024)/1024),2), bytes_inMB=round(((bytes_in/1024)/1024),2), bytes_outMB=round(((bytes_out/1024)/1024),2) &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;| eval Start_time=strftime(_time,"%Y/%m/%d %H:%M:%S"), End_time=(strftime(_time + duration,"%Y/%m/%d %H:%M:%S")), Total_time=if(isnull(full_duration), Start_time." --&amp;gt; current session",Start_time." --&amp;gt; ".End_time) &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;| mvexpand src &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;| iplocation src &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;| eval LocationIP=City.", ".Country &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;| stats values(Total_time) as "Session Time" values(src) as "PublicIP" values(LocationIP) as LocationIP values(IP) as "Assigned IP" values(reason) as "Termination Reason" values(bytesMB) as bytesMB values(bytes_inMB) as bytes_inMB values(bytes_outMB) as bytes_outMB values(full_duration) as Duration by _time, user &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;| sort -_time &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;| search PublicIP=*&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for your help, it was awesome.&lt;/P&gt;&lt;P&gt;James \o/&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jul 2020 12:56:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/How-to-calculate-the-total-vpn-connection-time-per-user/m-p/511107#M8281</guid>
      <dc:creator>jfeitosa_real</dc:creator>
      <dc:date>2020-07-27T12:56:00Z</dc:date>
    </item>
  </channel>
</rss>

