<?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 get accurate transaction results for VPN Sessions which start or end at either side of the search time boundaries? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-accurate-transaction-results-for-VPN-Sessions-which/m-p/280864#M84766</link>
    <description>&lt;P&gt;That is exactly it! Thank you so much for your help Javier. Very much appreciated.&lt;/P&gt;

&lt;P&gt;Cheers,&lt;/P&gt;

&lt;P&gt;Rob.&lt;/P&gt;</description>
    <pubDate>Wed, 16 Dec 2015 14:31:51 GMT</pubDate>
    <dc:creator>soniquella</dc:creator>
    <dc:date>2015-12-16T14:31:51Z</dc:date>
    <item>
      <title>How to get accurate transaction results for VPN Sessions which start or end at either side of the search time boundaries?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-accurate-transaction-results-for-VPN-Sessions-which/m-p/280861#M84763</link>
      <description>&lt;P&gt;Good morning. I hope you can help.&lt;/P&gt;

&lt;P&gt;I have been tasked with creating a chart for the top 25 users who spend the longest accumulated duration on our VPN sessions over a timespan of 7 days.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=hostname* sourcetype="WinEventLog:System" EventCode=20272  | rex field=Message ": The user (?&amp;lt;user&amp;gt;\S+)"| rex field=_raw  " The user was active for (?&amp;lt;sess_len_min&amp;gt;\d+) minutes (?&amp;lt;sess_len_secs&amp;gt;\d+)" | eval Total_Sess_Len = sess_len_min*60 + sess_len_secs |  stats sum(Total_Sess_Len) as TotalSession by user | sort 25 -TotalSession | eval TotalSession = tostring(TotalSession, "duration")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The problem that I have is that if I search this over a period of 60 minutes, then a user's session may have STARTED before the timespan search and therefore returns a duration of longer than 60 minutes which based over a week's search would not give accurate results.&lt;/P&gt;

&lt;P&gt;I understand that you can keep orphan events, but again, this would not give an accurate reflection of all session durations based over a set time period if sessions start or end either side of the time boundaries.&lt;/P&gt;

&lt;P&gt;Any help that you could offer would be greatly appreciated.&lt;/P&gt;

&lt;P&gt;Cheers,&lt;/P&gt;

&lt;P&gt;Rob.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Dec 2015 11:33:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-accurate-transaction-results-for-VPN-Sessions-which/m-p/280861#M84763</guid>
      <dc:creator>soniquella</dc:creator>
      <dc:date>2015-12-16T11:33:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to get accurate transaction results for VPN Sessions which start or end at either side of the search time boundaries?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-accurate-transaction-results-for-VPN-Sessions-which/m-p/280862#M84764</link>
      <description>&lt;P&gt;Let me see if I get this right:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;UserA starts a session on "December 15th 08:00:00" and finalises that session 5 hours later "December 15th 13:00:00"&lt;/LI&gt;
&lt;LI&gt;Now you run your search for the last 24 hours: "December 15th 11:00:00" - "December 16th 11:00:00"&lt;/LI&gt;
&lt;LI&gt;Your eventlog returns 5 hours (300 minutes) for UserA&lt;/LI&gt;
&lt;LI&gt;But the output should be 2 hours (5 minus 3) because the search started 3 hours after UserA logged in&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;If that's what you are trying to achieve then you will need to:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;Store search start time in variable: MySearchStartTime&lt;/LI&gt;
&lt;LI&gt;Calculate when the VPN session started by subtracting the length of your session (minutes+seconds) from your event to your event Timestamp. Store this on MyVPNStartTime&lt;/LI&gt;
&lt;LI&gt;If MyVPNStartTime &amp;lt; MySearchStartTime =&amp;gt; MySessionTime = "NumberOfMinutesSeconds" - (MySearchStartTime - MyVPNStartTime)&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Hope that's clear enough&lt;/P&gt;</description>
      <pubDate>Wed, 16 Dec 2015 12:20:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-accurate-transaction-results-for-VPN-Sessions-which/m-p/280862#M84764</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2015-12-16T12:20:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to get accurate transaction results for VPN Sessions which start or end at either side of the search time boundaries?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-accurate-transaction-results-for-VPN-Sessions-which/m-p/280863#M84765</link>
      <description>&lt;P&gt;By the way, if you want to use the start time and end time of your search take a look at &lt;A href="https://answers.splunk.com/answers/49539/variables-indicating-the-time-range-of-the-interactive-search-selection.html"&gt;this&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Dec 2015 12:24:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-accurate-transaction-results-for-VPN-Sessions-which/m-p/280863#M84765</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2015-12-16T12:24:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to get accurate transaction results for VPN Sessions which start or end at either side of the search time boundaries?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-accurate-transaction-results-for-VPN-Sessions-which/m-p/280864#M84766</link>
      <description>&lt;P&gt;That is exactly it! Thank you so much for your help Javier. Very much appreciated.&lt;/P&gt;

&lt;P&gt;Cheers,&lt;/P&gt;

&lt;P&gt;Rob.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Dec 2015 14:31:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-accurate-transaction-results-for-VPN-Sessions-which/m-p/280864#M84766</guid>
      <dc:creator>soniquella</dc:creator>
      <dc:date>2015-12-16T14:31:51Z</dc:date>
    </item>
  </channel>
</rss>

