<?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: How to get the target Account Name from WinEventLog:Security in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-target-Account-Name-from-WinEventLog-Security/m-p/669294#M229557</link>
    <description>&lt;P&gt;If Splunk already extracted two Account Names, wouldn't it be simpler to call the first value and second value different names?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="wineventlog" EventCode=4726
| eval SubjectAccountName = mvindex('Account Name', 0)
| eval TargetAccountName = mvindex('Account Name', 1)&lt;/LI-CODE&gt;&lt;P&gt;Also, I remember that some says Windows events can come in as JSON. &amp;nbsp;If you have structured data, you don't need to worry about these at all.&lt;/P&gt;</description>
    <pubDate>Tue, 21 Nov 2023 07:10:22 GMT</pubDate>
    <dc:creator>yuanliu</dc:creator>
    <dc:date>2023-11-21T07:10:22Z</dc:date>
    <item>
      <title>How to get the target Account Name from WinEventLog:Security</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-target-Account-Name-from-WinEventLog-Security/m-p/669211#M229533</link>
      <description>&lt;P&gt;This is an example of an event for EventCode=4726. As you see there are two account name fields which the Splunk App parses as ... two account names&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;11/19/2023 01:00:38 PM
LogName=Security
EventCode=4726
EventType=0
ComputerName=dc.acme.com
SourceName=Microsoft Windows security auditing.
Type=Information
RecordNumber=1539804373
Keywords=Audit Success
TaskCategory=User Account Management
OpCode=Info
Message=A user account was deleted.

Subject:
	Security ID:		Acme\ScriptRobot
	Account Name:		ScriptRobot
	Account Domain:		Acme
	Logon ID:		0x997B8B20

Target Account:
	Security ID:		S-1-5-21-329068152-1767777339-1801674531-65826
	Account Name:		aml
	Account Domain:		Acme

Additional Information:
	Privileges	-&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to search for all events with Subject:Account Name = ScriptRobot and then list all Target Account: Account Name. Knowing that multiline regex can be a bit cumbersome - tried the following search string, but it does not work&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="wineventlog" EventCode=4726 | rex "Subject Account Name:\s+Account Name:\s+(?&amp;lt;SubjectAccount&amp;gt;[^\s]+).*\s+Target Account:\s+Account Name:\s+(?&amp;lt;TargetAccount&amp;gt;[^\s]+)"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Nov 2023 15:30:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-target-Account-Name-from-WinEventLog-Security/m-p/669211#M229533</guid>
      <dc:creator>rune_hellem</dc:creator>
      <dc:date>2023-11-20T15:30:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the target Account Name from WinEventLog:Security</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-target-Account-Name-from-WinEventLog-Security/m-p/669294#M229557</link>
      <description>&lt;P&gt;If Splunk already extracted two Account Names, wouldn't it be simpler to call the first value and second value different names?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="wineventlog" EventCode=4726
| eval SubjectAccountName = mvindex('Account Name', 0)
| eval TargetAccountName = mvindex('Account Name', 1)&lt;/LI-CODE&gt;&lt;P&gt;Also, I remember that some says Windows events can come in as JSON. &amp;nbsp;If you have structured data, you don't need to worry about these at all.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2023 07:10:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-target-Account-Name-from-WinEventLog-Security/m-p/669294#M229557</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-11-21T07:10:22Z</dc:date>
    </item>
  </channel>
</rss>

