<?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 EventID - account name from 2 different events in one search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/EventID-account-name-from-2-different-events-in-one-search/m-p/558235#M158562</link>
    <description>&lt;P&gt;Hi all, I'm a Splunk beginner and I'm having a hard time getting this particular search down.&lt;/P&gt;&lt;P&gt;My objective is to get the "Account_Name" field from 2 different event codes (4624 type 10 &amp;amp; 4778).&amp;nbsp; This issue is I can't figure out how to get both the 2nd instance of Account_Name for only the 4624, but the first instance of it in the 4778.&amp;nbsp; This is because windows uses the Account_Name field twice in a lot of logs, but not in some.&amp;nbsp; So I need the first Account_Name in 4778, and the second Account_Name in 4624.&lt;BR /&gt;&lt;BR /&gt;Here is what I have so far.&amp;nbsp; Having trouble putting in that middle piece.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=main source="WinEventLog:Security" ("eventcode=4624" AND Logon_Type=10) | eval Acct=mvindex(Account_Name,1)

***Also find "eventcode=4778" Account_Name****

| rename Acct as "Account Used on Remote Machine" 
| rename Client_Name as "Source Machine" 
| rename ComputerName as "Destination Machine" 
| timechart count by "Account Used on Remote Machine"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 03 Jul 2021 19:23:16 GMT</pubDate>
    <dc:creator>icewolf69</dc:creator>
    <dc:date>2021-07-03T19:23:16Z</dc:date>
    <item>
      <title>EventID - account name from 2 different events in one search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/EventID-account-name-from-2-different-events-in-one-search/m-p/558235#M158562</link>
      <description>&lt;P&gt;Hi all, I'm a Splunk beginner and I'm having a hard time getting this particular search down.&lt;/P&gt;&lt;P&gt;My objective is to get the "Account_Name" field from 2 different event codes (4624 type 10 &amp;amp; 4778).&amp;nbsp; This issue is I can't figure out how to get both the 2nd instance of Account_Name for only the 4624, but the first instance of it in the 4778.&amp;nbsp; This is because windows uses the Account_Name field twice in a lot of logs, but not in some.&amp;nbsp; So I need the first Account_Name in 4778, and the second Account_Name in 4624.&lt;BR /&gt;&lt;BR /&gt;Here is what I have so far.&amp;nbsp; Having trouble putting in that middle piece.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=main source="WinEventLog:Security" ("eventcode=4624" AND Logon_Type=10) | eval Acct=mvindex(Account_Name,1)

***Also find "eventcode=4778" Account_Name****

| rename Acct as "Account Used on Remote Machine" 
| rename Client_Name as "Source Machine" 
| rename ComputerName as "Destination Machine" 
| timechart count by "Account Used on Remote Machine"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 03 Jul 2021 19:23:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/EventID-account-name-from-2-different-events-in-one-search/m-p/558235#M158562</guid>
      <dc:creator>icewolf69</dc:creator>
      <dc:date>2021-07-03T19:23:16Z</dc:date>
    </item>
    <item>
      <title>Re: EventID - account name from 2 different events in one search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/EventID-account-name-from-2-different-events-in-one-search/m-p/558238#M158565</link>
      <description>&lt;LI-CODE lang="markup"&gt;index=main source="WinEventLog:Security" ("eventcode=4624" AND Logon_Type=10)&lt;/LI-CODE&gt;&lt;P&gt;This has limited your pipeline of events to just event cod 4624. What you probably need to do in include 4778 events as well&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=main source="WinEventLog:Security" ("eventcode=4624" AND Logon_Type=10) OR "eventcode=4778"&lt;/LI-CODE&gt;&lt;P&gt;You now probably need to merge them into a single event in the pipeline?&lt;/P&gt;&lt;P&gt;You can do this with something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| stats count by Account_name&lt;/LI-CODE&gt;&lt;P&gt;However, this will just give you a count of events by Account_name whether that event was a 4624 or 4778&lt;/P&gt;&lt;P&gt;Given that you seem to be using timechart, do you want the count of events within particular time periods?&lt;/P&gt;&lt;P&gt;Start with the search returning both type of events and decide what you want to do with those.&lt;/P&gt;</description>
      <pubDate>Sat, 03 Jul 2021 21:32:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/EventID-account-name-from-2-different-events-in-one-search/m-p/558238#M158565</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-07-03T21:32:25Z</dc:date>
    </item>
    <item>
      <title>Re: EventID - account name from 2 different events in one search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/EventID-account-name-from-2-different-events-in-one-search/m-p/558239#M158566</link>
      <description>&lt;P&gt;I can add 4778 easy enough, the issue is since they both use different "Account_Name" fields, I get garbage trying to filter either one:&lt;/P&gt;&lt;P&gt;4624:&lt;/P&gt;&lt;P&gt;Account_Name,0 = garbage&lt;/P&gt;&lt;P&gt;Account_Name,1=good, what I want to collect&lt;/P&gt;&lt;P&gt;4778:&lt;/P&gt;&lt;P&gt;Account_Name,0=good, what I want to collect&lt;/P&gt;&lt;P&gt;Account_Name,1=does not exist in log, garbage&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I try to collect both events "Account_Name,0", I&amp;nbsp; get half junk, half good events.&amp;nbsp; It's the same trying to collect "Account_Name,1" because since "Account_Name,1" doesn't exist in the 4778, it has no information to collect and the log is filtered.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need someway to filter out the 4624 "Account_Name,0".... Or possibly ignore it and join "Account_Name,1" with "Account_Name" from 4778.&lt;/P&gt;</description>
      <pubDate>Sat, 03 Jul 2021 22:20:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/EventID-account-name-from-2-different-events-in-one-search/m-p/558239#M158566</guid>
      <dc:creator>icewolf69</dc:creator>
      <dc:date>2021-07-03T22:20:32Z</dc:date>
    </item>
    <item>
      <title>Re: EventID - account name from 2 different events in one search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/EventID-account-name-from-2-different-events-in-one-search/m-p/558245#M158568</link>
      <description>&lt;LI-CODE lang="markup"&gt;| eval Account_name=if(eventcode="4624",mvindex(Account_name,1),mvindex(Account_name,0))&lt;/LI-CODE&gt;</description>
      <pubDate>Sun, 04 Jul 2021 06:35:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/EventID-account-name-from-2-different-events-in-one-search/m-p/558245#M158568</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-07-04T06:35:55Z</dc:date>
    </item>
  </channel>
</rss>

