<?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: Finding the 1st logon and logoff event times for a single user from March 2017 to present. in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Finding-the-1st-logon-and-logoff-event-times-for-a-single-user/m-p/304085#M57387</link>
    <description>&lt;P&gt;Is this still true? I've been asked to do pretty much the exact same thing. Not logon and logoff times each day, but time spent on a specific server/resource&lt;/P&gt;</description>
    <pubDate>Fri, 18 Jan 2019 00:18:45 GMT</pubDate>
    <dc:creator>nick405060</dc:creator>
    <dc:date>2019-01-18T00:18:45Z</dc:date>
    <item>
      <title>Finding the 1st logon and logoff event times for a single user from March 2017 to present.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Finding-the-1st-logon-and-logoff-event-times-for-a-single-user/m-p/304083#M57385</link>
      <description>&lt;P&gt;Hello, &lt;/P&gt;

&lt;P&gt;I've been asked to find the 1st login time of a user and the time they logged out over a specific date range. (march 1st 2017 - present) &lt;/P&gt;

&lt;P&gt;The environment is a Window's terminal services environment (Windows Server 2008 R2) and is being indexed into Splunk. The index is &lt;STRONG&gt;index= index="wineventlog"&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;I'd like to see something like this; &lt;EM&gt;(if possible)&lt;/EM&gt;&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;username: user&lt;/LI&gt;
&lt;LI&gt;date: 01/MAR/2017&lt;/LI&gt;
&lt;LI&gt;Logon: 07:30:00 &lt;/LI&gt;
&lt;LI&gt;Logoff: 15:30:00 &lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;For each day from march 1st to present, I can find the events but can't order them or filter them to show just the 1st login and last logoff of that day. &lt;/P&gt;

&lt;P&gt;Appreciate the help, &lt;BR /&gt;
Jake &lt;/P&gt;</description>
      <pubDate>Tue, 29 Aug 2017 09:04:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Finding-the-1st-logon-and-logoff-event-times-for-a-single-user/m-p/304083#M57385</guid>
      <dc:creator>JPurdham</dc:creator>
      <dc:date>2017-08-29T09:04:11Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the 1st logon and logoff event times for a single user from March 2017 to present.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Finding-the-1st-logon-and-logoff-event-times-for-a-single-user/m-p/304084#M57386</link>
      <description>&lt;P&gt;Hi JPurdham,&lt;BR /&gt;
it's not a problem to have the first logon (EventCode=4624) but the problem is that in Windows a logon action generates many (more than 10) logon events (4624, 4672, 4634, ...) and it's difficoult to find the real logoff because there isn't a transaction code to connect events.&lt;BR /&gt;
You could use username, but if you have more logons of the same user on the same host in the same day you cannot distinguish them.&lt;BR /&gt;
Anyway, you could run something like this in the time period you need:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=wineventlog sourcetype=WinEventLog:Security (EventCode=4624 OR EventCode=4634)
| eval day=strftime(_time,"%d/%m/%Y")
| stats earliest(_time) AS earliest latest(_time) AS latest by user host day
| eval earliest=strftime(earliest,"%d/%m/%Y %H.%M.%S"), latest=strftime(latest,"%d/%m/%Y %H.%M.%S")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 29 Aug 2017 10:49:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Finding-the-1st-logon-and-logoff-event-times-for-a-single-user/m-p/304084#M57386</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-08-29T10:49:49Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the 1st logon and logoff event times for a single user from March 2017 to present.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Finding-the-1st-logon-and-logoff-event-times-for-a-single-user/m-p/304085#M57387</link>
      <description>&lt;P&gt;Is this still true? I've been asked to do pretty much the exact same thing. Not logon and logoff times each day, but time spent on a specific server/resource&lt;/P&gt;</description>
      <pubDate>Fri, 18 Jan 2019 00:18:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Finding-the-1st-logon-and-logoff-event-times-for-a-single-user/m-p/304085#M57387</guid>
      <dc:creator>nick405060</dc:creator>
      <dc:date>2019-01-18T00:18:45Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the 1st logon and logoff event times for a single user from March 2017 to present.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Finding-the-1st-logon-and-logoff-event-times-for-a-single-user/m-p/304086#M57388</link>
      <description>&lt;P&gt;This worked great for me. &lt;BR /&gt;
After I Americanized the date format.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jan 2020 21:14:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Finding-the-1st-logon-and-logoff-event-times-for-a-single-user/m-p/304086#M57388</guid>
      <dc:creator>benbabich</dc:creator>
      <dc:date>2020-01-16T21:14:35Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the 1st logon and logoff event times for a single user from March 2017 to present.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Finding-the-1st-logon-and-logoff-event-times-for-a-single-user/m-p/304087#M57389</link>
      <description>&lt;P&gt;Hi JPurdham,&lt;BR /&gt;
if this answer solves your problem, please accept and/or upvote it for the other people of the Community.&lt;BR /&gt;
Ciao and next time.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jan 2020 07:38:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Finding-the-1st-logon-and-logoff-event-times-for-a-single-user/m-p/304087#M57389</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-01-17T07:38:45Z</dc:date>
    </item>
  </channel>
</rss>

