<?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: Mismatch '[' error in field extraction using regular expression in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Mismatch-error-in-field-extraction-using-regular-expression/m-p/348049#M103076</link>
    <description>&lt;P&gt;Above is the sample event . I have to extract "ij10k222.25898" from the event&lt;/P&gt;</description>
    <pubDate>Thu, 19 Apr 2018 11:49:17 GMT</pubDate>
    <dc:creator>Manonmani5</dc:creator>
    <dc:date>2018-04-19T11:49:17Z</dc:date>
    <item>
      <title>Mismatch '[' error in field extraction using regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Mismatch-error-in-field-extraction-using-regular-expression/m-p/348038#M103065</link>
      <description>&lt;P&gt;I am a new splunk user and apologies for this dump question. I tried to extract a field with the fort "servername:portnumber"&lt;BR /&gt;&lt;BR /&gt;
 ( ex: sd45j478889:23684) using field extractor. &lt;/P&gt;

&lt;P&gt;I got the below regular expression in field extractor.&lt;/P&gt;

&lt;P&gt;^(?:[^"\n]*"){8}\s+(?P[^ ]+)&lt;/P&gt;

&lt;P&gt;This didn't worked for all the events because of different sourcetypes. So I tried to use this regex in my search. When I used this in my search I am getting  "Mismatch '[' " error. Below is the query I used.&lt;/P&gt;

&lt;P&gt;index= xyz | rex "^(?:[^"\n]*"){8}\s+(?P[^ ]+)"|table Port&lt;/P&gt;

&lt;P&gt;I couldn't find what is wrong with the expression. can someone please help&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 08:20:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Mismatch-error-in-field-extraction-using-regular-expression/m-p/348038#M103065</guid>
      <dc:creator>Manonmani5</dc:creator>
      <dc:date>2018-04-18T08:20:09Z</dc:date>
    </item>
    <item>
      <title>Re: Mismatch '[' error in field extraction using regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Mismatch-error-in-field-extraction-using-regular-expression/m-p/348039#M103066</link>
      <description>&lt;P&gt;Can you try:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex "^(?:[^\"\n]*"){8}\s+(?P[^ ]+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Also try :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex "(?P&amp;lt;servername&amp;gt;[^\:]+):(?P&amp;lt;portnumber&amp;gt;+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Apr 2018 08:24:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Mismatch-error-in-field-extraction-using-regular-expression/m-p/348039#M103066</guid>
      <dc:creator>p_gurav</dc:creator>
      <dc:date>2018-04-18T08:24:04Z</dc:date>
    </item>
    <item>
      <title>Re: Mismatch '[' error in field extraction using regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Mismatch-error-in-field-extraction-using-regular-expression/m-p/348040#M103067</link>
      <description>&lt;P&gt;Thanks. It didn't worked. For the second one 'I got error as 'Error in 'rex' command: Encountered the following error while compiling the regex '(?P[^:]+):(?P+)': Regex: nothing to repeat'.&lt;/P&gt;

&lt;P&gt;And for the first I got error like 'Error in 'SearchParser': Missing a search command before '^'. Error at position '64' of search query 'search index= spider_prod | rex "^(?:[^\"\n]*"){8...{snipped} {errorcontext = (?P[^ ]+)"}'.'&lt;/P&gt;

&lt;P&gt;Below is the search condition I used for the first one.&lt;/P&gt;

&lt;P&gt;index= xyz |  rex "^(?:[^\"\n]*"){8}\s+(?P[^ ]+)"&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 10:09:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Mismatch-error-in-field-extraction-using-regular-expression/m-p/348040#M103067</guid>
      <dc:creator>Manonmani5</dc:creator>
      <dc:date>2018-04-18T10:09:08Z</dc:date>
    </item>
    <item>
      <title>Re: Mismatch '[' error in field extraction using regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Mismatch-error-in-field-extraction-using-regular-expression/m-p/348041#M103068</link>
      <description>&lt;P&gt;Can you try :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field= _raw "(?P&amp;lt;servername&amp;gt;[^\:]+):(?P&amp;lt;portnumber&amp;gt;+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Apr 2018 10:22:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Mismatch-error-in-field-extraction-using-regular-expression/m-p/348041#M103068</guid>
      <dc:creator>p_gurav</dc:creator>
      <dc:date>2018-04-18T10:22:44Z</dc:date>
    </item>
    <item>
      <title>Re: Mismatch '[' error in field extraction using regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Mismatch-error-in-field-extraction-using-regular-expression/m-p/348042#M103069</link>
      <description>&lt;P&gt;Also one question &lt;CODE&gt;servername:portnumber&lt;/CODE&gt; is always same the way you specified in example. Is it field or you are extracting from raw event. Can you provide whole event?&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 10:24:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Mismatch-error-in-field-extraction-using-regular-expression/m-p/348042#M103069</guid>
      <dc:creator>p_gurav</dc:creator>
      <dc:date>2018-04-18T10:24:55Z</dc:date>
    </item>
    <item>
      <title>Re: Mismatch '[' error in field extraction using regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Mismatch-error-in-field-extraction-using-regular-expression/m-p/348043#M103070</link>
      <description>&lt;OL&gt;
&lt;LI&gt;Can you please provide the whole event.&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Wed, 18 Apr 2018 10:35:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Mismatch-error-in-field-extraction-using-regular-expression/m-p/348043#M103070</guid>
      <dc:creator>kthammireddygar</dc:creator>
      <dc:date>2018-04-18T10:35:54Z</dc:date>
    </item>
    <item>
      <title>Re: Mismatch '[' error in field extraction using regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Mismatch-error-in-field-extraction-using-regular-expression/m-p/348044#M103071</link>
      <description>&lt;P&gt;Yes.. The format is same... But the server name and port number will be different based on servers. While executing the above regex I am getting error as "The regex '_raw' does not extract anything. It should specify at least one named group. Format: (?...). "&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 11:40:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Mismatch-error-in-field-extraction-using-regular-expression/m-p/348044#M103071</guid>
      <dc:creator>Manonmani5</dc:creator>
      <dc:date>2018-04-18T11:40:25Z</dc:date>
    </item>
    <item>
      <title>Re: Mismatch '[' error in field extraction using regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Mismatch-error-in-field-extraction-using-regular-expression/m-p/348045#M103072</link>
      <description>&lt;P&gt;I already made a group called servername and portnumber above?  My mistake, remove space:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=_raw "(?P&amp;lt;servername&amp;gt;[^\:]+):(?P&amp;lt;portnumber&amp;gt;+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Apr 2018 11:55:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Mismatch-error-in-field-extraction-using-regular-expression/m-p/348045#M103072</guid>
      <dc:creator>p_gurav</dc:creator>
      <dc:date>2018-04-18T11:55:04Z</dc:date>
    </item>
    <item>
      <title>Re: Mismatch '[' error in field extraction using regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Mismatch-error-in-field-extraction-using-regular-expression/m-p/348046#M103073</link>
      <description>&lt;P&gt;can you give a sample of your raw event?&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 11:57:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Mismatch-error-in-field-extraction-using-regular-expression/m-p/348046#M103073</guid>
      <dc:creator>Sukisen1981</dc:creator>
      <dc:date>2018-04-18T11:57:54Z</dc:date>
    </item>
    <item>
      <title>Re: Mismatch '[' error in field extraction using regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Mismatch-error-in-field-extraction-using-regular-expression/m-p/348047#M103074</link>
      <description>&lt;P&gt;@Manonmani5 while posting sample event or code, please use the &lt;CODE&gt;code&lt;/CODE&gt; button (&lt;CODE&gt;101010&lt;/CODE&gt; or &lt;CODE&gt;CTRL+K&lt;/CODE&gt;) on Splunk Answers to ensure that special characters in your code or sample data does not get escaped. Alternatively you can add four spaces before each line of your code and make sure there is an enter before the first line of code.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 16:19:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Mismatch-error-in-field-extraction-using-regular-expression/m-p/348047#M103074</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-04-18T16:19:11Z</dc:date>
    </item>
    <item>
      <title>Re: Mismatch '[' error in field extraction using regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Mismatch-error-in-field-extraction-using-regular-expression/m-p/348048#M103075</link>
      <description>&lt;P&gt;30.130.51.1 eps.vincetryu.com - [19/Apr/2018:07:44:36 -0400] "GET /tyywuenndri/css/select2.png HTTP/1.1" 200 613 "&lt;A href="https://eps.nyuehrnf.com/ajeunx/css/select2.css"&gt;https://eps.nyuehrnf.com/ajeunx/css/select2.css&lt;/A&gt;" "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36" "3373" "ij10k222:25898"&lt;/P&gt;</description>
      <pubDate>Thu, 19 Apr 2018 11:48:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Mismatch-error-in-field-extraction-using-regular-expression/m-p/348048#M103075</guid>
      <dc:creator>Manonmani5</dc:creator>
      <dc:date>2018-04-19T11:48:07Z</dc:date>
    </item>
    <item>
      <title>Re: Mismatch '[' error in field extraction using regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Mismatch-error-in-field-extraction-using-regular-expression/m-p/348049#M103076</link>
      <description>&lt;P&gt;Above is the sample event . I have to extract "ij10k222.25898" from the event&lt;/P&gt;</description>
      <pubDate>Thu, 19 Apr 2018 11:49:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Mismatch-error-in-field-extraction-using-regular-expression/m-p/348049#M103076</guid>
      <dc:creator>Manonmani5</dc:creator>
      <dc:date>2018-04-19T11:49:17Z</dc:date>
    </item>
    <item>
      <title>Re: Mismatch '[' error in field extraction using regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Mismatch-error-in-field-extraction-using-regular-expression/m-p/348050#M103077</link>
      <description>&lt;P&gt;This is the error I am getting."Error in 'rex' command: Encountered the following error while compiling the regex '(?P[^:]+):(?P+)': Regex: nothing to repeat"&lt;BR /&gt;
Sample Event:&lt;BR /&gt;
 [19/Apr/2018:07:44:36 -0400] "GET /tyywuenndri/css/select2.png HTTP/1.1" 200 613 "&lt;A href="https://eps.nyuehrnf.com/ajeunx/css/select2.css"&gt;https://eps.nyuehrnf.com/ajeunx/css/select2.css&lt;/A&gt;" "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36" "3373" "ij10k222:25898"&lt;/P&gt;</description>
      <pubDate>Thu, 19 Apr 2018 11:52:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Mismatch-error-in-field-extraction-using-regular-expression/m-p/348050#M103077</guid>
      <dc:creator>Manonmani5</dc:creator>
      <dc:date>2018-04-19T11:52:51Z</dc:date>
    </item>
    <item>
      <title>Re: Mismatch '[' error in field extraction using regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Mismatch-error-in-field-extraction-using-regular-expression/m-p/348051#M103078</link>
      <description>&lt;P&gt;[19/Apr/2018:07:44:36 -0400] "GET /tyywuenndri/css/select2.png HTTP/1.1" 200 613 "&lt;A href="https://eps.nyuehrnf.com/ajeunx/css/select2.css"&gt;https://eps.nyuehrnf.com/ajeunx/css/select2.css&lt;/A&gt;" "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36" "3373" "ij10k222:25898"&lt;/P&gt;</description>
      <pubDate>Thu, 19 Apr 2018 11:53:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Mismatch-error-in-field-extraction-using-regular-expression/m-p/348051#M103078</guid>
      <dc:creator>Manonmani5</dc:creator>
      <dc:date>2018-04-19T11:53:13Z</dc:date>
    </item>
    <item>
      <title>Re: Mismatch '[' error in field extraction using regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Mismatch-error-in-field-extraction-using-regular-expression/m-p/348052#M103079</link>
      <description>&lt;P&gt;Try this : &lt;/P&gt;

&lt;P&gt;index=abc sourcetype=xyz | &lt;CODE&gt;rex "\"(?P&amp;lt;Servername&amp;gt;\w+)\:(?P&amp;lt;Portnumber&amp;gt;\d+)\""&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Apr 2018 12:16:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Mismatch-error-in-field-extraction-using-regular-expression/m-p/348052#M103079</guid>
      <dc:creator>kthammireddygar</dc:creator>
      <dc:date>2018-04-19T12:16:25Z</dc:date>
    </item>
    <item>
      <title>Re: Mismatch '[' error in field extraction using regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Mismatch-error-in-field-extraction-using-regular-expression/m-p/348053#M103080</link>
      <description>&lt;P&gt;Thanks.. This worked for me&lt;/P&gt;</description>
      <pubDate>Mon, 23 Apr 2018 08:28:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Mismatch-error-in-field-extraction-using-regular-expression/m-p/348053#M103080</guid>
      <dc:creator>Manonmani5</dc:creator>
      <dc:date>2018-04-23T08:28:06Z</dc:date>
    </item>
    <item>
      <title>Re: Mismatch '[' error in field extraction using regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Mismatch-error-in-field-extraction-using-regular-expression/m-p/348054#M103081</link>
      <description>&lt;P&gt;May I know what was the problem with the below regex.&lt;/P&gt;

&lt;P&gt;^(?:[^"\n]*"){8}\s+(?P[^ ]+)&lt;/P&gt;

&lt;P&gt;This expression I got when I extracted the field using 'Field Extractor'&lt;/P&gt;</description>
      <pubDate>Mon, 23 Apr 2018 08:29:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Mismatch-error-in-field-extraction-using-regular-expression/m-p/348054#M103081</guid>
      <dc:creator>Manonmani5</dc:creator>
      <dc:date>2018-04-23T08:29:50Z</dc:date>
    </item>
  </channel>
</rss>

