<?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: What is the best way to find out users' working hours per day? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-find-out-users-working-hours-per-day/m-p/260077#M77954</link>
    <description>&lt;P&gt;Little bit of self promotion, but any approach based on windows logs or network logs is going to be an approximation given the various assumptions. You need to get a more specific type of user activity data to be really accurate for this kind of report.&lt;/P&gt;

&lt;P&gt;Such Splunk-compatible sources are Layer8 and uberAgent.&lt;/P&gt;</description>
    <pubDate>Thu, 01 Dec 2016 21:08:04 GMT</pubDate>
    <dc:creator>rjthibod</dc:creator>
    <dc:date>2016-12-01T21:08:04Z</dc:date>
    <item>
      <title>What is the best way to find out users' working hours per day?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-find-out-users-working-hours-per-day/m-p/260071#M77948</link>
      <description>&lt;P&gt;Hi &lt;/P&gt;

&lt;P&gt;I have a use case to find users' working hours with start time and end time. Which events will show the information required? I tried proxy logs, is there a way to find out working hours with Windows Event Logs?&lt;/P&gt;

&lt;P&gt;search I'm using:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=wineventlog sourcetype="WinEventLog:Security" "username" &amp;nbsp;&amp;nbsp;| eval time=_time | timechart&amp;nbsp; span=1d min(time) as "Logon Time", max(time) as "Logoff Time"| convert&amp;nbsp; timeformat="%m/%d/%y %H:%M:%S" ctime(*)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But its not showing exact values.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2016 17:53:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-find-out-users-working-hours-per-day/m-p/260071#M77948</guid>
      <dc:creator>kiran331</dc:creator>
      <dc:date>2016-12-01T17:53:57Z</dc:date>
    </item>
    <item>
      <title>Re: What is the best way to find out users' working hours per day?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-find-out-users-working-hours-per-day/m-p/260072#M77949</link>
      <description>&lt;P&gt;Splunk is tricky with both _time and timechart command. Something like the following may be closer to mark. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=wineventlog sourcetype="WinEventLog:Security" "username"
| stats min(_time) AS Logon max(_time) AS Logoff min(_time) AS _time by username date_mday date_year
| eval HOURS_WORKED=(Logoff-Logon)/(60*60)
| timechart span=1d HOURS_WORKED by username
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Note assuming username field is extracted. date_mday date_year are being used to isolate days without touching _time field. Keeping min(_time) AS _time allows timechart command to plot on correct day without a lot of work.&lt;/P&gt;

&lt;P&gt;Not tested but should be close. Good luck. &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:57:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-find-out-users-working-hours-per-day/m-p/260072#M77949</guid>
      <dc:creator>snoobzilla</dc:creator>
      <dc:date>2020-09-29T11:57:50Z</dc:date>
    </item>
    <item>
      <title>Re: What is the best way to find out users' working hours per day?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-find-out-users-working-hours-per-day/m-p/260073#M77950</link>
      <description>&lt;P&gt;See if this works (this assumes user login/logoff once a day)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=WinEventLog:Security (EventCode=4624 OR EventCode=4634) | eval Date=strftime(_time, "%Y/%m/%d") | stats earliest(eval(if(EventCode=4624, _time, null())) as Login earliest(eval(if(EventCode=4634, _time, null())) as Logoff by host user | eval duration=Logoff-Login | eval duration=tostring(duration, "duration")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If more than once a day, try using &lt;CODE&gt;transaction&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=WinEventLog:Security (EventCode=4624 OR EventCode=4634) (Logon_Type=2 OR Logon_Type=10) | transaction host user startswith=EventCode=4624 endswith=EventCode=4634 |eval duration = tostring(duration, "duration") | table _time host user duration 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;To further improve this search you can play with LogonType (2=Desktop 10=RDP etc)&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2016 20:50:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-find-out-users-working-hours-per-day/m-p/260073#M77950</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-12-01T20:50:50Z</dc:date>
    </item>
    <item>
      <title>Re: What is the best way to find out users' working hours per day?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-find-out-users-working-hours-per-day/m-p/260074#M77951</link>
      <description>&lt;P&gt;You would also want to consider LogonType 11 for cached logons as well.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2016 20:56:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-find-out-users-working-hours-per-day/m-p/260074#M77951</guid>
      <dc:creator>rjthibod</dc:creator>
      <dc:date>2016-12-01T20:56:57Z</dc:date>
    </item>
    <item>
      <title>Re: What is the best way to find out users' working hours per day?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-find-out-users-working-hours-per-day/m-p/260075#M77952</link>
      <description>&lt;P&gt;I'm seeing Logon type=3, I get the logs from all Domain Controllers.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2016 20:58:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-find-out-users-working-hours-per-day/m-p/260075#M77952</guid>
      <dc:creator>kiran331</dc:creator>
      <dc:date>2016-12-01T20:58:29Z</dc:date>
    </item>
    <item>
      <title>Re: What is the best way to find out users' working hours per day?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-find-out-users-working-hours-per-day/m-p/260076#M77953</link>
      <description>&lt;P&gt;Are all of you logons showing up at type 3 or just the most recent per user? If the latter, I would imagine that would be the side-effect of some network-based resource being made available, e.g., printer or shared drive. If not, then I am not so sure why they would all show up as type 3. I am not an admin/expert on this matter, just know enough to be dangerous.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2016 21:03:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-find-out-users-working-hours-per-day/m-p/260076#M77953</guid>
      <dc:creator>rjthibod</dc:creator>
      <dc:date>2016-12-01T21:03:45Z</dc:date>
    </item>
    <item>
      <title>Re: What is the best way to find out users' working hours per day?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-find-out-users-working-hours-per-day/m-p/260077#M77954</link>
      <description>&lt;P&gt;Little bit of self promotion, but any approach based on windows logs or network logs is going to be an approximation given the various assumptions. You need to get a more specific type of user activity data to be really accurate for this kind of report.&lt;/P&gt;

&lt;P&gt;Such Splunk-compatible sources are Layer8 and uberAgent.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2016 21:08:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-find-out-users-working-hours-per-day/m-p/260077#M77954</guid>
      <dc:creator>rjthibod</dc:creator>
      <dc:date>2016-12-01T21:08:04Z</dc:date>
    </item>
  </channel>
</rss>

