<?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: Why is my regex causing Splunk to return the following error?: &amp;quot;Regex: missing terminating ] for character class&amp;quot; in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-regex-causing-Splunk-to-return-the-following-error/m-p/456944#M129140</link>
    <description>&lt;P&gt;thank you!!!  It works like a charm.&lt;/P&gt;</description>
    <pubDate>Thu, 01 Nov 2018 12:00:28 GMT</pubDate>
    <dc:creator>Task1906</dc:creator>
    <dc:date>2018-11-01T12:00:28Z</dc:date>
    <item>
      <title>Why is my regex causing Splunk to return the following error?: "Regex: missing terminating ] for character class"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-regex-causing-Splunk-to-return-the-following-error/m-p/456941#M129137</link>
      <description>&lt;P&gt;Rexex101 works GREAT.  However, Splunk gives me an error.  I keep getting the following error with the regex below:&lt;BR /&gt;
I am trying to extract everything before \ or \&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Error in 'rex' command: Encountered the following error while compiling the regex '(?[^].&lt;/EM&gt;)': Regex: missing terminating ] for character class&lt;/STRONG&gt;*&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=src_user "\\(?&amp;lt;user&amp;gt;[^\\].*)" 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Here are the examples of what I'm trying to extract:&lt;BR /&gt;
DTTSOL-EAST\SQLAdmin&lt;BR /&gt;
DTTSOL-EAST\SQLAdmin&lt;BR /&gt;
task@delly\mason&lt;BR /&gt;
DANNY@rand\D&lt;BR /&gt;
calicoe\iron&lt;/P&gt;

&lt;P&gt;What am I doing wrong and should I use something else besides regxex101?&lt;/P&gt;</description>
      <pubDate>Thu, 01 Nov 2018 05:12:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-my-regex-causing-Splunk-to-return-the-following-error/m-p/456941#M129137</guid>
      <dc:creator>Task1906</dc:creator>
      <dc:date>2018-11-01T05:12:35Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my regex causing Splunk to return the following error?: "Regex: missing terminating ] for character class"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-regex-causing-Splunk-to-return-the-following-error/m-p/456942#M129138</link>
      <description>&lt;P&gt;@Task1906&lt;/P&gt;

&lt;P&gt;Can you please try this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Your_search  | rex field=src_user "\\\\(?&amp;lt;user&amp;gt;[^\\\\].*)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Sample Search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults | eval src_user="DTTSOL-EAST\\SQLAdmin"  | rex field=src_user "\\\\(?&amp;lt;user&amp;gt;[^\\\\].*)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 01 Nov 2018 05:30:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-my-regex-causing-Splunk-to-return-the-following-error/m-p/456942#M129138</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2018-11-01T05:30:26Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my regex causing Splunk to return the following error?: "Regex: missing terminating ] for character class"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-regex-causing-Splunk-to-return-the-following-error/m-p/456943#M129139</link>
      <description>&lt;P&gt;Assuming the number of backslashes can vary, I would just go for the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=src_user "[\\\]+(?&amp;lt;user&amp;gt;[^\\\]+)$"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
J&lt;/P&gt;</description>
      <pubDate>Thu, 01 Nov 2018 08:43:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-my-regex-causing-Splunk-to-return-the-following-error/m-p/456943#M129139</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2018-11-01T08:43:21Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my regex causing Splunk to return the following error?: "Regex: missing terminating ] for character class"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-regex-causing-Splunk-to-return-the-following-error/m-p/456944#M129140</link>
      <description>&lt;P&gt;thank you!!!  It works like a charm.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Nov 2018 12:00:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-my-regex-causing-Splunk-to-return-the-following-error/m-p/456944#M129140</guid>
      <dc:creator>Task1906</dc:creator>
      <dc:date>2018-11-01T12:00:28Z</dc:date>
    </item>
  </channel>
</rss>

