<?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: Show Only Logon Events in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Show-Only-Logon-Events/m-p/236614#M176164</link>
    <description>&lt;P&gt;i will try that thank you for now &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 29 Nov 2016 09:58:07 GMT</pubDate>
    <dc:creator>vessev</dc:creator>
    <dc:date>2016-11-29T09:58:07Z</dc:date>
    <item>
      <title>Show Only Logon Events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Show-Only-Logon-Events/m-p/236612#M176162</link>
      <description>&lt;P&gt;I simply will audit our Administrators on which Systems they are logged on right now.&lt;/P&gt;

&lt;P&gt;but i cannot separate only EventCode 4625 Events who has no EventCode 4634 Event.&lt;BR /&gt;
The major Problem here is that the EventCodes for Login and Logoff dealing with Logon_ID's&lt;BR /&gt;
I will sort out every Logon Event (and Logoff Event) which has a specific Logoff Event.&lt;/P&gt;

&lt;P&gt;first i tryed this way&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=wineventlog source="WinEventLog:Security" EventCode=4624 OR EventCode=4634 Account_Name=server-*   
| eval User=if(mvcount(Account_Name)&amp;gt;1, mvindex(Account_Name,1), mvindex(Account_Name, 0)) 
| eval logid=if(mvcount(Logon_ID)&amp;gt;1, mvindex(Logon_ID,1),mvindex(Logon_ID,0)) 
| eval LogonID_4624=if(EventCode="4624", mvindex(Logon_ID, 1), null()) 
| eval LogonID_4634=if(EventCode="4634", Logon_ID, null()) 
| transaction fields="User" maxspan=-1
| eval Keep_Or_Not=if(LogonID_4624=LogonID_4634, "Keep", "Do_Not_Keep")
| search Keep_Or_Not="Do_Not_Keep"
| table _time, User, EventCode, Keep_Or_Not, LogonID_4624, LogonID_4634, Source_Network_Address, IP_RESOLVED, tag::app 
| sort by User
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;then there was no success so i tried another query:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=wineventlog source="WinEventLog:Security" EventCode=4624 OR EventCode=4634 Account_Name=server-evermann   
| eval User=if(mvcount(Account_Name)&amp;gt;1, mvindex(Account_Name,1), mvindex(Account_Name, 0)) 
| eval logid=if(mvcount(Logon_ID)&amp;gt;1, mvindex(Logon_ID,1),mvindex(Logon_ID,0)) 
| eval LogonID_4624=if(EventCode="4624", mvindex(Logon_ID, 1), null()) 
| eval LogonID_4634=if(EventCode="4634", Logon_ID, null())
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I thank you&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2016 10:23:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Show-Only-Logon-Events/m-p/236612#M176162</guid>
      <dc:creator>vessev</dc:creator>
      <dc:date>2016-11-23T10:23:39Z</dc:date>
    </item>
    <item>
      <title>Re: Show Only Logon Events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Show-Only-Logon-Events/m-p/236613#M176163</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=wineventlog source="WinEventLog:Security" EventCode=4624 OR EventCode=4634 Account_Name=server-* | eval User=if(mvcount(Account_Name)&amp;gt;1, mvindex(Account_Name,1), mvindex(Account_Name, 0)) | transaction User startswith="EventCode=4625" endswith="EventCode=4634" maxspan=8h maxevents=2 keepevicted=t | where closed_txn=0 | table _time User EventCode
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 23 Nov 2016 14:23:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Show-Only-Logon-Events/m-p/236613#M176163</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-11-23T14:23:06Z</dc:date>
    </item>
    <item>
      <title>Re: Show Only Logon Events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Show-Only-Logon-Events/m-p/236614#M176164</link>
      <description>&lt;P&gt;i will try that thank you for now &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Nov 2016 09:58:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Show-Only-Logon-Events/m-p/236614#M176164</guid>
      <dc:creator>vessev</dc:creator>
      <dc:date>2016-11-29T09:58:07Z</dc:date>
    </item>
    <item>
      <title>Re: Show Only Logon Events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Show-Only-Logon-Events/m-p/236615#M176165</link>
      <description>&lt;P&gt;i have found out that i can have a NOT search as subsearch. Here every Event is kicked out who has the logon id in EventCode 4634.&lt;BR /&gt;
Its not a search query for Real Time searches but it kinda does its work.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Account_Name=server-evermann EventCode=4624 | eval logid=mvindex(Logon_ID, 1) | search NOT [search Account_Name=server-evermann EventCode=4634 | rename Logon_ID as logid | table logid] | table _time, logid, Source_Network_Address, host | sort - _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The second problem is way worse, and that is something i found out through solving that problem. &lt;BR /&gt;
A Logon Event on a DC is not like you think it is. Sometimes more than 4 Events are generated when logging on a System.&lt;BR /&gt;
Which all have different Logon_ID's .. .a few minutes later all the Logon_ID's are marked as Logoff ( From EventCode 4634) even the connection is still established. That's because not the Logon from the user is generating the Logon Event 4624 - the Update from GPO does this. That means ive got an EventCode 4624 generatet on every Logon i do on a Server (and force a user specific GPO Update Force) which comes on every 90 minutes (depending on your configuration on how often the GPO should Update) and gets a Logoff Event when the Update is done ... &lt;/P&gt;

&lt;P&gt;Does anyone has the same Problem with domain user logging? I simply Log all my DC's and thought i could catch all Logon and Logoff actions in my Domain. I dont think that it is nessesary to install a universal forwarder on every Server in my domain or use WMI (which is a lame piece of crap in my opinion) or is it?!&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:56:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Show-Only-Logon-Events/m-p/236615#M176165</guid>
      <dc:creator>vessev</dc:creator>
      <dc:date>2020-09-29T11:56:51Z</dc:date>
    </item>
  </channel>
</rss>

