<?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: Duplicate Field Extraction - Failed Logins in Windows 2008 Security Logs in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Duplicate-Field-Extraction-Failed-Logins-in-Windows-2008/m-p/89515#M22954</link>
    <description>&lt;P&gt;I've forgot to add the multiline and dot-all flag to the regex. I've edited the search expression above.&lt;/P&gt;</description>
    <pubDate>Sat, 20 Nov 2010 22:18:31 GMT</pubDate>
    <dc:creator>ziegfried</dc:creator>
    <dc:date>2010-11-20T22:18:31Z</dc:date>
    <item>
      <title>Duplicate Field Extraction - Failed Logins in Windows 2008 Security Logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Duplicate-Field-Extraction-Failed-Logins-in-Windows-2008/m-p/89507#M22946</link>
      <description>&lt;P&gt;I'm trying to perform a seemingly simple task, which is to search for failed logins in my AD environment.  Here's the search I used found in another &lt;A href="http://answers.splunk.com/questions/7812/search-help-for-failed-logins" rel="nofollow"&gt;Answer&lt;/A&gt;;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="WinEventLog:Security" EventCode="4625" OR EventCode="539" OR
(EventCode&amp;gt;="529" AND EventCode&amp;lt;="537") OR (EventCode&amp;gt;="547" AND EventCode&amp;lt;="549") hoursago="4"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Great!  I found some failed logins.  Now I want specific information out of this event which is the "Account Name" of the user who's having a problem.  Ewwww, but with Microsoft's lovely log format, they so graciously supply TWO "Account Name" fields with the same name;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;11/15/10 03:41:00 PM
LogName=Security
SourceName=Microsoft Windows security auditing.
EventCode=4625
EventType=0
Type=Information
ComputerName=SERVERNAME.DOMAIN.NAME
TaskCategory=Logon
OpCode=Info
RecordNumber=30965331
Keywords=Audit Failure
Message=An account failed to log on.

Subject:
    Security ID:        S-1-5-18
    Account Name:       SERVERNAME$  &amp;lt;-- 1st occurrence
    Account Domain:     DOMAIN
    Logon ID:       0x3e7

Logon Type:         8

Account For Which Logon Failed:
    Security ID:        S-1-0-0
    Account Name:       username    &amp;lt;-- 2nd occurrence
    Account Domain:     domain.name

Failure Information:
    Failure Reason:     Unknown user name or bad password.
    Status:         0xc000006d
    Sub Status:     0xc000006a

Process Information:
    Caller Process ID:  0x1a40
    Caller Process Name:    C:\Windows\System32\inetsrv\w3wp.exe

Network Information:
    Workstation Name:   SERVERNAME
    Source Network Address: 11.22.33.44
    Source Port:        2453

Detailed Authentication Information:
    Logon Process:      Advapi  
    Authentication Package: Negotiate
    Transited Services: -
    Package Name (NTLM only):   -
    Key Length:     0
&amp;lt;snip&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want that second occurrence of "Account Name" (which holds username).  Now you may already be thinking, hey buddy this question has been asked before -- go search because the answers out there (&lt;A href="http://answers.splunk.com/questions/6178/multiline-events-with-fields-with-same-name-windows-2008-logs" rel="nofollow"&gt;one&lt;/A&gt;, &lt;A href="http://answers.splunk.com/questions/2649/same-fields-with-different-values-in-one-event" rel="nofollow"&gt;two&lt;/A&gt;) are to use "| eval newVar=mvindex(Account_Name,1)"...&lt;/P&gt;

&lt;P&gt;...but hear me out.  It's not behaving as expected.&lt;/P&gt;

&lt;P&gt;So I adjust my search to store the 2nd occurrence of "Account Name" in a new variable and dump them into a table;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="WinEventLog:Security" EventCode="4625" OR EventCode="539" OR
(EventCode&amp;gt;="529" AND EventCode&amp;lt;="537") OR (EventCode&amp;gt;="547" AND EventCode&amp;lt;="549") hoursago="4"
| eval newVar=mvindex(Account_Name,1)
| table Account_Name newVar
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Here's the problem, this results in;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SERVERNAME$    &amp;lt;blank&amp;gt;    
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I can't get the value of the 2nd occurrence.  Reading the documentation on &lt;A href="http://www.splunk.com/base/Documentation/4.1.5/User/ParseFieldsWithMultipleValues" rel="nofollow"&gt;Parse Fields With Multiple Values&lt;/A&gt; doesn't shed any light on my problem.&lt;/P&gt;

&lt;P&gt;So I tried grabbing the last value; "newVar=mvindex(Account_Name,-1)" but that outputs blank as well.  So I start to question if mvindex is doing anything...
...but the strange thing is that this "newVar=mvindex(Account_Name,0)" seems to store/retrieve just fine despite it not being the data I want.&lt;/P&gt;

&lt;P&gt;Can someone point me in the right direction?  Thanks in advance.&lt;/P&gt;

&lt;P&gt;Running 4.1.5 Linux x86_64&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;H2&gt;ziegfried Solution&lt;/H2&gt;

&lt;PRE&gt;&lt;CODE&gt;source="WinEventLog:Security" EventCode="4625" OR EventCode="539" OR 
(EventCode&amp;gt;="529" AND EventCode&amp;lt;="537") OR (EventCode&amp;gt;="547" AND EventCode&amp;lt;="549") hoursago="4"
| rex "(?ms)Account For Which Logon Failed.+?Account Name:\s+(?&amp;lt;Wanted_Account&amp;gt;\V+)"
| table _time Account_Name Wanted_Account ComputerName Failure_Reason src_ip Workstation_Name
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 16 Nov 2010 07:03:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Duplicate-Field-Extraction-Failed-Logins-in-Windows-2008/m-p/89507#M22946</guid>
      <dc:creator>pstraw</dc:creator>
      <dc:date>2010-11-16T07:03:10Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate Field Extraction - Failed Logins in Windows 2008 Security Logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Duplicate-Field-Extraction-Failed-Logins-in-Windows-2008/m-p/89508#M22947</link>
      <description>&lt;P&gt;How are you extracting the Account_Name field(s)?&lt;BR /&gt;
What does this return?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="WinEventLog:Security" EventCode="4625" OR EventCode="539" OR 
(EventCode&amp;gt;="529" AND EventCo`de&amp;lt;="537") OR (EventCode&amp;gt;="547" AND 
EventCode&amp;lt;="549") hoursago="4" 
| rex field=_raw max_match=99 "Account Name:\s+(?&amp;lt;Account_Name&amp;gt;\w+\$?)" 
| eval Wanted_Account=mvindex(Account_Name,1)
| table Wanted_Account
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 17 Nov 2010 07:23:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Duplicate-Field-Extraction-Failed-Logins-in-Windows-2008/m-p/89508#M22947</guid>
      <dc:creator>bwooden</dc:creator>
      <dc:date>2010-11-17T07:23:42Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate Field Extraction - Failed Logins in Windows 2008 Security Logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Duplicate-Field-Extraction-Failed-Logins-in-Windows-2008/m-p/89509#M22948</link>
      <description>&lt;P&gt;When you show Account_Name as an enabled field in the Event Viewer, do you get multiple occurrences of Account_Name or just 1 occurrence with the value being the 1st extraction (SERVERNAME$)?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 09:21:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Duplicate-Field-Extraction-Failed-Logins-in-Windows-2008/m-p/89509#M22948</guid>
      <dc:creator>hulahoop</dc:creator>
      <dc:date>2020-09-28T09:21:01Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate Field Extraction - Failed Logins in Windows 2008 Security Logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Duplicate-Field-Extraction-Failed-Logins-in-Windows-2008/m-p/89510#M22949</link>
      <description>&lt;P&gt;added results of your query to the original post.  sure wish there was a code tag function in comments.  thanks for your help so far.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Nov 2010 00:49:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Duplicate-Field-Extraction-Failed-Logins-in-Windows-2008/m-p/89510#M22949</guid>
      <dc:creator>pstraw</dc:creator>
      <dc:date>2010-11-18T00:49:17Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate Field Extraction - Failed Logins in Windows 2008 Security Logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Duplicate-Field-Extraction-Failed-Logins-in-Windows-2008/m-p/89511#M22950</link>
      <description>&lt;P&gt;Account_Name in the Events Table/View shows the 1st occurrence which typically is "-" or SERVERNAME$&lt;/P&gt;

&lt;P&gt;I am correct in my understanding that the Events view/table, you can not display custom/new variables?  Those will only display in the Results view/table?&lt;/P&gt;</description>
      <pubDate>Thu, 18 Nov 2010 00:56:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Duplicate-Field-Extraction-Failed-Logins-in-Windows-2008/m-p/89511#M22950</guid>
      <dc:creator>pstraw</dc:creator>
      <dc:date>2010-11-18T00:56:43Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate Field Extraction - Failed Logins in Windows 2008 Security Logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Duplicate-Field-Extraction-Failed-Logins-in-Windows-2008/m-p/89512#M22951</link>
      <description>&lt;P&gt;An options is to extract the Account name after the ocurrence of "Account For Which Logon Failed":&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="WinEventLog:Security" EventCode="4625" OR EventCode="539" OR 
(EventCode&amp;gt;="529" AND EventCo`de&amp;lt;="537") OR (EventCode&amp;gt;="547" AND 
EventCode&amp;lt;="549") hoursago="4" 
| rex "(?ms)Account For Which Logon Failed.+?Account Name:\s+(?&amp;lt;wanted_account&amp;gt;\V+)"
| table wanted_account
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 18 Nov 2010 01:06:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Duplicate-Field-Extraction-Failed-Logins-in-Windows-2008/m-p/89512#M22951</guid>
      <dc:creator>ziegfried</dc:creator>
      <dc:date>2010-11-18T01:06:01Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate Field Extraction - Failed Logins in Windows 2008 Security Logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Duplicate-Field-Extraction-Failed-Logins-in-Windows-2008/m-p/89513#M22952</link>
      <description>&lt;P&gt;thank you bwooden!  your rex helped.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Nov 2010 03:21:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Duplicate-Field-Extraction-Failed-Logins-in-Windows-2008/m-p/89513#M22952</guid>
      <dc:creator>pstraw</dc:creator>
      <dc:date>2010-11-18T03:21:35Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate Field Extraction - Failed Logins in Windows 2008 Security Logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Duplicate-Field-Extraction-Failed-Logins-in-Windows-2008/m-p/89514#M22953</link>
      <description>&lt;P&gt;wanted_account in the Results Table returns blank for this query.&lt;/P&gt;</description>
      <pubDate>Sat, 20 Nov 2010 02:48:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Duplicate-Field-Extraction-Failed-Logins-in-Windows-2008/m-p/89514#M22953</guid>
      <dc:creator>pstraw</dc:creator>
      <dc:date>2010-11-20T02:48:11Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate Field Extraction - Failed Logins in Windows 2008 Security Logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Duplicate-Field-Extraction-Failed-Logins-in-Windows-2008/m-p/89515#M22954</link>
      <description>&lt;P&gt;I've forgot to add the multiline and dot-all flag to the regex. I've edited the search expression above.&lt;/P&gt;</description>
      <pubDate>Sat, 20 Nov 2010 22:18:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Duplicate-Field-Extraction-Failed-Logins-in-Windows-2008/m-p/89515#M22954</guid>
      <dc:creator>ziegfried</dc:creator>
      <dc:date>2010-11-20T22:18:31Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate Field Extraction - Failed Logins in Windows 2008 Security Logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Duplicate-Field-Extraction-Failed-Logins-in-Windows-2008/m-p/89516#M22955</link>
      <description>&lt;P&gt;your query is working now.  edit to remove the stray &lt;CODE&gt;in EventCo&lt;/CODE&gt;de&amp;lt;="537"&lt;/P&gt;</description>
      <pubDate>Sun, 21 Nov 2010 02:13:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Duplicate-Field-Extraction-Failed-Logins-in-Windows-2008/m-p/89516#M22955</guid>
      <dc:creator>pstraw</dc:creator>
      <dc:date>2010-11-21T02:13:54Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate Field Extraction - Failed Logins in Windows 2008 Security Logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Duplicate-Field-Extraction-Failed-Logins-in-Windows-2008/m-p/89517#M22956</link>
      <description>&lt;P&gt;How do I combine this with the "User_Name" field from the Windows 2003 "529" events?  I want to create a top 10 count by the UserName + Account_Name&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:21:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Duplicate-Field-Extraction-Failed-Logins-in-Windows-2008/m-p/89517#M22956</guid>
      <dc:creator>aberdamy</dc:creator>
      <dc:date>2020-09-28T16:21:35Z</dc:date>
    </item>
  </channel>
</rss>

