<?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: Error in &amp;quot;SearchParser&amp;quot; mismatched ']' in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Error-in-quot-SearchParser-quot-mismatched/m-p/482266#M8584</link>
    <description>&lt;P&gt;@gaurav_maniar  Hi Gaurav! Yea that is part of it, but the issue also resides in the first half of the query for example the first half here "raw "(?ms)^(?:[^\"\n]*\"){6}(?P\d+)" also gives me the same error... what am i suppose to escape here?&lt;/P&gt;</description>
    <pubDate>Mon, 13 Jan 2020 14:40:36 GMT</pubDate>
    <dc:creator>eid1550</dc:creator>
    <dc:date>2020-01-13T14:40:36Z</dc:date>
    <item>
      <title>Error in "SearchParser" mismatched ']'</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Error-in-quot-SearchParser-quot-mismatched/m-p/482262#M8580</link>
      <description>&lt;P&gt;I am using the python splunk SDK to run a query, and this part of the query is giving me the above mismatched brackets error.&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;| rex field=_raw "(?ms)^(?:[^\"\\n]*\"){6}(?P&amp;lt;Error_code&amp;gt;\\d+)(?:[^\"\\n]*\"){4}(?P&amp;lt;Error_description&amp;gt;[^\\\\]+)"&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;It works when I put it in the actual splunk search, but when I run it through python its giving me that error. What could be the problem?&lt;/P&gt;</description>
      <pubDate>Sun, 07 Jun 2020 18:35:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Error-in-quot-SearchParser-quot-mismatched/m-p/482262#M8580</guid>
      <dc:creator>eid1550</dc:creator>
      <dc:date>2020-06-07T18:35:12Z</dc:date>
    </item>
    <item>
      <title>Re: Error in "SearchParser" mismatched ']'</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Error-in-quot-SearchParser-quot-mismatched/m-p/482263#M8581</link>
      <description>&lt;P&gt;Can you share the Python snippet where you use the regex?&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jan 2020 04:37:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Error-in-quot-SearchParser-quot-mismatched/m-p/482263#M8581</guid>
      <dc:creator>jawaharas</dc:creator>
      <dc:date>2020-01-13T04:37:17Z</dc:date>
    </item>
    <item>
      <title>Re: Error in "SearchParser" mismatched ']'</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Error-in-quot-SearchParser-quot-mismatched/m-p/482264#M8582</link>
      <description>&lt;P&gt;@jawaharas  Hi the python is just in a variable like this &lt;/P&gt;

&lt;P&gt;query = """| rex field=_raw "(?ms)^(?:[^\"\n]&lt;EM&gt;\"){6}(?P\d+)(?:[^\"\n]&lt;/EM&gt;\"){4}(?P[^\\]+)"""&lt;/P&gt;

&lt;P&gt;then executed later.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jan 2020 14:18:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Error-in-quot-SearchParser-quot-mismatched/m-p/482264#M8582</guid>
      <dc:creator>eid1550</dc:creator>
      <dc:date>2020-01-13T14:18:49Z</dc:date>
    </item>
    <item>
      <title>Re: Error in "SearchParser" mismatched ']'</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Error-in-quot-SearchParser-quot-mismatched/m-p/482265#M8583</link>
      <description>&lt;P&gt;Hi Eid,&lt;/P&gt;

&lt;P&gt;You query regex works fine in Splunk web, but haven't checked with python.&lt;BR /&gt;
As it is being used in python, the reason you are getting this error is most probably due to character escaping &lt;CODE&gt;\\&lt;/CODE&gt; at the end of your regex.&lt;/P&gt;

&lt;P&gt;Try to play around character escapes at &lt;CODE&gt;&amp;lt;Error_description&amp;gt;[^\\\\]&lt;/CODE&gt; and it will solve your problem.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jan 2020 14:36:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Error-in-quot-SearchParser-quot-mismatched/m-p/482265#M8583</guid>
      <dc:creator>gaurav_maniar</dc:creator>
      <dc:date>2020-01-13T14:36:27Z</dc:date>
    </item>
    <item>
      <title>Re: Error in "SearchParser" mismatched ']'</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Error-in-quot-SearchParser-quot-mismatched/m-p/482266#M8584</link>
      <description>&lt;P&gt;@gaurav_maniar  Hi Gaurav! Yea that is part of it, but the issue also resides in the first half of the query for example the first half here "raw "(?ms)^(?:[^\"\n]*\"){6}(?P\d+)" also gives me the same error... what am i suppose to escape here?&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jan 2020 14:40:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Error-in-quot-SearchParser-quot-mismatched/m-p/482266#M8584</guid>
      <dc:creator>eid1550</dc:creator>
      <dc:date>2020-01-13T14:40:36Z</dc:date>
    </item>
    <item>
      <title>Re: Error in "SearchParser" mismatched ']'</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Error-in-quot-SearchParser-quot-mismatched/m-p/482267#M8585</link>
      <description>&lt;P&gt;You should escape all the special characters (like double quote) used in your variable string.&lt;/P&gt;

&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;query = "| rex field=_raw \"(?ms)^(?:[^\"\\n]\"){6}(?P\\d+)(?:[^\"\\n]\"){4}(?P[^\\\]+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 13 Jan 2020 23:51:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Error-in-quot-SearchParser-quot-mismatched/m-p/482267#M8585</guid>
      <dc:creator>jawaharas</dc:creator>
      <dc:date>2020-01-13T23:51:16Z</dc:date>
    </item>
    <item>
      <title>Re: Error in "SearchParser" mismatched ']'</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Error-in-quot-SearchParser-quot-mismatched/m-p/482268#M8586</link>
      <description>&lt;P&gt;@jawaharas yeah it says the same thing "Error in search parser mis matched ']' its a nightmare.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jan 2020 16:08:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Error-in-quot-SearchParser-quot-mismatched/m-p/482268#M8586</guid>
      <dc:creator>eid1550</dc:creator>
      <dc:date>2020-01-14T16:08:43Z</dc:date>
    </item>
    <item>
      <title>Re: Error in "SearchParser" mismatched ']'</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Error-in-quot-SearchParser-quot-mismatched/m-p/482269#M8587</link>
      <description>&lt;P&gt;I figured it out after A LOT of trial and error. the following is the "python version" I kept printing what python say and kept modyifying it so it looks like the string in splunk IDE&lt;/P&gt;

&lt;P&gt;| rex field=_raw "(?ms)^(?:[^\\"\\n]&lt;EM&gt;\\"){6}(?P\\d+)(?:[^\\"\\n]&lt;/EM&gt;\\"){4}(?P[^\\\\]+)"&lt;/P&gt;

&lt;P&gt;thank you for your help and guiding me in the right direction&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jan 2020 19:38:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Error-in-quot-SearchParser-quot-mismatched/m-p/482269#M8587</guid>
      <dc:creator>eid1550</dc:creator>
      <dc:date>2020-01-14T19:38:17Z</dc:date>
    </item>
    <item>
      <title>Re: Error in "SearchParser" mismatched ']'</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Error-in-quot-SearchParser-quot-mismatched/m-p/482270#M8588</link>
      <description>&lt;P&gt;Glad, it worked out for you. Can you upvote and accept the answer if it's helped you? Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jan 2020 22:43:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Error-in-quot-SearchParser-quot-mismatched/m-p/482270#M8588</guid>
      <dc:creator>jawaharas</dc:creator>
      <dc:date>2020-01-14T22:43:47Z</dc:date>
    </item>
  </channel>
</rss>

