<?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: Help with regex in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Help-with-regex/m-p/406193#M117422</link>
    <description>&lt;P&gt;I see it now, regardless the Regex I posted is faster with less steps and should solve your problem&lt;/P&gt;</description>
    <pubDate>Tue, 15 Jan 2019 21:36:56 GMT</pubDate>
    <dc:creator>skoelpin</dc:creator>
    <dc:date>2019-01-15T21:36:56Z</dc:date>
    <item>
      <title>Help with regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-regex/m-p/406190#M117419</link>
      <description>&lt;P&gt;Below is the sample event&lt;/P&gt;

&lt;P&gt;01/15/2019 03:49:15 PM&lt;BR /&gt;
LogName=Security&lt;BR /&gt;
SourceName=Microsoft Windows security auditing.&lt;BR /&gt;
EventCode=4738&lt;BR /&gt;
EventType=0&lt;BR /&gt;
Type=Information&lt;BR /&gt;
ComputerName=STM12R2DC003.abc.com&lt;BR /&gt;
TaskCategory=User Account Management&lt;BR /&gt;
OpCode=Info&lt;BR /&gt;
RecordNumber=2309384837&lt;BR /&gt;
Keywords=Audit Success&lt;BR /&gt;
Message=A user account was changed.&lt;/P&gt;

&lt;P&gt;Subject:&lt;BR /&gt;
    Security ID:        COMPANY\KS3840&lt;BR /&gt;
    Account Name:       KS3840&lt;BR /&gt;
    Account Domain:     company&lt;BR /&gt;
    Logon ID:       0x94B1FF95&lt;/P&gt;

&lt;P&gt;Target Account:&lt;BR /&gt;
    Security ID:        COMPANY\BArandallAU8340&lt;BR /&gt;
    Account Name:       BArandallAU8340&lt;BR /&gt;
    Account Domain:     COMPANY&lt;/P&gt;

&lt;P&gt;I am trying to extract the one highlighted an using the following regex which I made using regex.101.It is working in correctly in regex101 but when used the same regex it is throwing error Regex: unmatched closing parenthesis&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Regex
(Target\sAccount\:\s+Security\sID\:\s*)COMPANY\\(?&amp;lt;ABC&amp;gt;[^ ]+)Account

In Splunk

|rex field=_raw "(Target\sAccount\:\s+Security\sID\:\s*)COMPANY\\(?&amp;lt;ABC&amp;gt;[^ ]+)Account"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;output&lt;/P&gt;

&lt;P&gt;BArandallAU8340&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jan 2019 21:19:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-regex/m-p/406190#M117419</guid>
      <dc:creator>vrmandadi</dc:creator>
      <dc:date>2019-01-15T21:19:25Z</dc:date>
    </item>
    <item>
      <title>Re: Help with regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-regex/m-p/406191#M117420</link>
      <description>&lt;P&gt;You need to escape the parenthesis to avoid this error. You can use a backslash to do it before the parenthesis&lt;/P&gt;

&lt;P&gt;Also, I don't see a field name for your regular expression. Try this instead, your field name will be &lt;CODE&gt;CompanyName&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;COMPANY\*(?&amp;lt;CompanyName&amp;gt;\w+)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 15 Jan 2019 21:27:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-regex/m-p/406191#M117420</guid>
      <dc:creator>skoelpin</dc:creator>
      <dc:date>2019-01-15T21:27:42Z</dc:date>
    </item>
    <item>
      <title>Re: Help with regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-regex/m-p/406192#M117421</link>
      <description>&lt;P&gt;I named the field as ABC&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jan 2019 21:32:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-regex/m-p/406192#M117421</guid>
      <dc:creator>vrmandadi</dc:creator>
      <dc:date>2019-01-15T21:32:09Z</dc:date>
    </item>
    <item>
      <title>Re: Help with regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-regex/m-p/406193#M117422</link>
      <description>&lt;P&gt;I see it now, regardless the Regex I posted is faster with less steps and should solve your problem&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jan 2019 21:36:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-regex/m-p/406193#M117422</guid>
      <dc:creator>skoelpin</dc:creator>
      <dc:date>2019-01-15T21:36:56Z</dc:date>
    </item>
    <item>
      <title>Re: Help with regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-regex/m-p/406194#M117423</link>
      <description>&lt;P&gt;I tried yours but it did not extract anything.I am trying to extract only the second account name in the event which is BArandallAU8340&lt;/P&gt;

&lt;P&gt;Security ID: COMPANY\BArandallAU8340&lt;BR /&gt;
Account Name: BArandallAU8340&lt;BR /&gt;
Account Domain: COMPANY&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jan 2019 21:48:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-regex/m-p/406194#M117423</guid>
      <dc:creator>vrmandadi</dc:creator>
      <dc:date>2019-01-15T21:48:34Z</dc:date>
    </item>
    <item>
      <title>Re: Help with regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-regex/m-p/406195#M117424</link>
      <description>&lt;P&gt;i FIGURED IT OUT&lt;/P&gt;

&lt;P&gt;Target\sAccount:\s+Security\sID:\s*COMPANY.(?\w+)&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jan 2019 21:56:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-regex/m-p/406195#M117424</guid>
      <dc:creator>vrmandadi</dc:creator>
      <dc:date>2019-01-15T21:56:55Z</dc:date>
    </item>
    <item>
      <title>Re: Help with regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-regex/m-p/406196#M117425</link>
      <description>&lt;P&gt;Did you modify your original sample data? It had a * in it previously and now it doesn't which explains why it didn't capture it. I see you have a working solution, please accept the answer to close it out &lt;/P&gt;</description>
      <pubDate>Tue, 15 Jan 2019 22:22:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-regex/m-p/406196#M117425</guid>
      <dc:creator>skoelpin</dc:creator>
      <dc:date>2019-01-15T22:22:20Z</dc:date>
    </item>
    <item>
      <title>Re: Help with regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-regex/m-p/406197#M117426</link>
      <description>&lt;P&gt;@vrmandadi can you accept the answer to close this out?&lt;/P&gt;</description>
      <pubDate>Wed, 06 Feb 2019 20:41:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-regex/m-p/406197#M117426</guid>
      <dc:creator>skoelpin</dc:creator>
      <dc:date>2019-02-06T20:41:38Z</dc:date>
    </item>
    <item>
      <title>Re: Help with regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-regex/m-p/406198#M117427</link>
      <description>&lt;P&gt;Without trying to modify your regex, does this help?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|rex field=_raw "((Target\sAccount\:\s+Security\sID\:\s*)COMPANY\\(?&amp;lt;ABC&amp;gt;[^ ]+)Account)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 08 Feb 2019 22:08:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-regex/m-p/406198#M117427</guid>
      <dc:creator>mydog8it</dc:creator>
      <dc:date>2019-02-08T22:08:19Z</dc:date>
    </item>
  </channel>
</rss>

