<?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 Why is rex failing to extract a field and getting error &amp;quot;Regex: unmatched parentheses&amp;quot;? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-is-rex-failing-to-extract-a-field-and-getting-error-quot/m-p/177575#M51056</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I would like to know if there is any restriction in the rex command because for all the rex field-extractions I've used, they worked fine except for this.&lt;/P&gt;

&lt;P&gt;The raw data is something like &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Jan 6 99:99:99 255.255.255.255 Authentication failed from 10.0.0.0: user 'BLAH-BLAH\userid' (blah blah)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I've tried couple ways to extract the userid from above such as:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"Authentication failed"|rex "(?i)^[^\\]*\\(?P&amp;lt;userid&amp;gt;[^']+)"    
"Authentication failed"|rex "user\s'\S+\\(?&amp;lt;userid&amp;gt;\w*)'"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;but both of them give "Regex: unmatched parentheses"  message. &lt;/P&gt;

&lt;P&gt;What am I doing wrong? Does Splunk fail to extract a field if too many resources are consumed?&lt;/P&gt;</description>
    <pubDate>Wed, 07 Jan 2015 02:12:19 GMT</pubDate>
    <dc:creator>hcheang</dc:creator>
    <dc:date>2015-01-07T02:12:19Z</dc:date>
    <item>
      <title>Why is rex failing to extract a field and getting error "Regex: unmatched parentheses"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-rex-failing-to-extract-a-field-and-getting-error-quot/m-p/177575#M51056</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I would like to know if there is any restriction in the rex command because for all the rex field-extractions I've used, they worked fine except for this.&lt;/P&gt;

&lt;P&gt;The raw data is something like &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Jan 6 99:99:99 255.255.255.255 Authentication failed from 10.0.0.0: user 'BLAH-BLAH\userid' (blah blah)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I've tried couple ways to extract the userid from above such as:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"Authentication failed"|rex "(?i)^[^\\]*\\(?P&amp;lt;userid&amp;gt;[^']+)"    
"Authentication failed"|rex "user\s'\S+\\(?&amp;lt;userid&amp;gt;\w*)'"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;but both of them give "Regex: unmatched parentheses"  message. &lt;/P&gt;

&lt;P&gt;What am I doing wrong? Does Splunk fail to extract a field if too many resources are consumed?&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jan 2015 02:12:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-rex-failing-to-extract-a-field-and-getting-error-quot/m-p/177575#M51056</guid>
      <dc:creator>hcheang</dc:creator>
      <dc:date>2015-01-07T02:12:19Z</dc:date>
    </item>
    <item>
      <title>Re: Why is rex failing to extract a field and getting error "Regex: unmatched parentheses"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-rex-failing-to-extract-a-field-and-getting-error-quot/m-p/177576#M51057</link>
      <description>&lt;P&gt;use backslash  before '&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jan 2015 06:23:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-rex-failing-to-extract-a-field-and-getting-error-quot/m-p/177576#M51057</guid>
      <dc:creator>kml_uvce</dc:creator>
      <dc:date>2015-01-07T06:23:04Z</dc:date>
    </item>
    <item>
      <title>Re: Why is rex failing to extract a field and getting error "Regex: unmatched parentheses"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-rex-failing-to-extract-a-field-and-getting-error-quot/m-p/177577#M51058</link>
      <description>&lt;P&gt;I don't think ' is escaped character but I tried anyways and it is still not working. Any other idea?&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jan 2015 20:44:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-rex-failing-to-extract-a-field-and-getting-error-quot/m-p/177577#M51058</guid>
      <dc:creator>hcheang</dc:creator>
      <dc:date>2015-01-07T20:44:26Z</dc:date>
    </item>
    <item>
      <title>Re: Why is rex failing to extract a field and getting error "Regex: unmatched parentheses"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-rex-failing-to-extract-a-field-and-getting-error-quot/m-p/177578#M51059</link>
      <description>&lt;P&gt;Ok I found the issue. Both queries I have provided above have backslash backslash (?.... and Splunk takes it as backslash(? ...." which is the reason why it kept saying unmatched parentheses. &lt;/P&gt;</description>
      <pubDate>Wed, 07 Jan 2015 21:56:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-rex-failing-to-extract-a-field-and-getting-error-quot/m-p/177578#M51059</guid>
      <dc:creator>hcheang</dc:creator>
      <dc:date>2015-01-07T21:56:39Z</dc:date>
    </item>
    <item>
      <title>Re: Why is rex failing to extract a field and getting error "Regex: unmatched parentheses"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-rex-failing-to-extract-a-field-and-getting-error-quot/m-p/177579#M51060</link>
      <description>&lt;P&gt;&lt;CODE&gt;|rex "user\s'\w+-?\w+.(?\w+)"&lt;/CODE&gt;  works where backslash is replaced by . token&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jan 2015 22:04:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-rex-failing-to-extract-a-field-and-getting-error-quot/m-p/177579#M51060</guid>
      <dc:creator>hcheang</dc:creator>
      <dc:date>2015-01-07T22:04:06Z</dc:date>
    </item>
    <item>
      <title>Re: Why is rex failing to extract a field and getting error "Regex: unmatched parentheses"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-rex-failing-to-extract-a-field-and-getting-error-quot/m-p/177580#M51061</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;|gentimes start=-1 |eval Raw = "'BLAH-BLAH\Raghav'"|rex field=Raw "\\\(?&amp;lt;UserID&amp;gt;\w+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;gives me the output &lt;STRONG&gt;Raghav&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jan 2015 22:39:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-rex-failing-to-extract-a-field-and-getting-error-quot/m-p/177580#M51061</guid>
      <dc:creator>Raghav2384</dc:creator>
      <dc:date>2015-01-07T22:39:00Z</dc:date>
    </item>
    <item>
      <title>Re: Why is rex failing to extract a field and getting error "Regex: unmatched parentheses"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-rex-failing-to-extract-a-field-and-getting-error-quot/m-p/177581#M51062</link>
      <description>&lt;P&gt;yeap that works as well! thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jan 2015 23:09:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-rex-failing-to-extract-a-field-and-getting-error-quot/m-p/177581#M51062</guid>
      <dc:creator>hcheang</dc:creator>
      <dc:date>2015-01-07T23:09:24Z</dc:date>
    </item>
  </channel>
</rss>

