<?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 Logon session time in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Logon-session-time/m-p/36347#M8089</link>
    <description>&lt;P&gt;I am trying to gather average login session times for a server given multiple users logon and logoff log entries. I am using ossec to filter the logs first so standard windows fields may not apply, but I have extracted the user field (called "user").  &lt;/P&gt;

&lt;P&gt;I am not really sure where to start since I cannot seem to figure out how to gather average user session times for any time period given there are multiple users.  &lt;/P&gt;

&lt;P&gt;Any ideas?&lt;/P&gt;</description>
    <pubDate>Tue, 01 Feb 2011 07:31:04 GMT</pubDate>
    <dc:creator>ghnwmlguy</dc:creator>
    <dc:date>2011-02-01T07:31:04Z</dc:date>
    <item>
      <title>Logon session time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Logon-session-time/m-p/36347#M8089</link>
      <description>&lt;P&gt;I am trying to gather average login session times for a server given multiple users logon and logoff log entries. I am using ossec to filter the logs first so standard windows fields may not apply, but I have extracted the user field (called "user").  &lt;/P&gt;

&lt;P&gt;I am not really sure where to start since I cannot seem to figure out how to gather average user session times for any time period given there are multiple users.  &lt;/P&gt;

&lt;P&gt;Any ideas?&lt;/P&gt;</description>
      <pubDate>Tue, 01 Feb 2011 07:31:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Logon-session-time/m-p/36347#M8089</guid>
      <dc:creator>ghnwmlguy</dc:creator>
      <dc:date>2011-02-01T07:31:04Z</dc:date>
    </item>
    <item>
      <title>Re: Logon session time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Logon-session-time/m-p/36348#M8090</link>
      <description>&lt;P&gt;If you have the events that indicate logon and logoff, you could build a transaction and then grab the duration, a la:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;YourSearch | transaction Username startswith=LogonEventID endswith=LogoffEventID 
           | eval DurationInMin = round(duration/60,2) 
           | stats avg(DurationInMin) as "Average Session Duration (Minutes)" by Username
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;A href="http://www.splunk.com/base/Documentation/latest/SearchReference/Transaction" rel="nofollow"&gt;http://www.splunk.com/base/Documentation/latest/SearchReference/Transaction&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Feb 2011 07:53:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Logon-session-time/m-p/36348#M8090</guid>
      <dc:creator>David</dc:creator>
      <dc:date>2011-02-01T07:53:02Z</dc:date>
    </item>
    <item>
      <title>Re: Logon session time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Logon-session-time/m-p/36349#M8091</link>
      <description>&lt;P&gt;Thanks David, I can't beleive that have never noticed the transaction command.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Feb 2011 09:07:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Logon-session-time/m-p/36349#M8091</guid>
      <dc:creator>ghnwmlguy</dc:creator>
      <dc:date>2011-02-01T09:07:10Z</dc:date>
    </item>
    <item>
      <title>Re: Logon session time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Logon-session-time/m-p/36350#M8092</link>
      <description>&lt;P&gt;Minor thing I'd do is only round &lt;EM&gt;after&lt;/EM&gt; taking the average: `... | stats avg(DurationInMin) as avgdur by Username | eval avgdur=round(avgdur/60,2) | rename avgdur as "Average Session Duration (Minutes)".&lt;/P&gt;</description>
      <pubDate>Tue, 01 Feb 2011 10:39:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Logon-session-time/m-p/36350#M8092</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2011-02-01T10:39:24Z</dc:date>
    </item>
    <item>
      <title>Re: Logon session time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Logon-session-time/m-p/36351#M8093</link>
      <description>&lt;P&gt;Also, &lt;EM&gt;if&lt;/EM&gt; there is a session ID (often there is not), it is probably more efficient (and definitely more scalable) to do: &lt;CODE&gt;YourSearch | stats range(_time) as sessiondur by sessionID,Username | stats sum(sessiondur) as user_total_dur by Username&lt;/CODE&gt; instead.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Feb 2011 10:41:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Logon-session-time/m-p/36351#M8093</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2011-02-01T10:41:50Z</dc:date>
    </item>
  </channel>
</rss>

