<?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: My regex is not working in Splunk although it works at regex101.com in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/My-regex-is-not-working-in-Splunk-although-it-works-at-regex101/m-p/323055#M96408</link>
    <description>&lt;P&gt;I would agree with @elliotproebstel !&lt;/P&gt;</description>
    <pubDate>Wed, 06 Dec 2017 20:25:51 GMT</pubDate>
    <dc:creator>rphillips_splk</dc:creator>
    <dc:date>2017-12-06T20:25:51Z</dc:date>
    <item>
      <title>My regex is not working in Splunk although it works at regex101.com</title>
      <link>https://community.splunk.com/t5/Splunk-Search/My-regex-is-not-working-in-Splunk-although-it-works-at-regex101/m-p/323052#M96405</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I have a field "group" these field contains some values with a prefix: "AD-". I need to get rid of the prefix.&lt;/P&gt;

&lt;P&gt;E.g &lt;BR /&gt;
 AD-test = test&lt;BR /&gt;
 ADtest = ADtest&lt;BR /&gt;
 test = test&lt;BR /&gt;
 AD-123 = 123&lt;BR /&gt;
 123 = 123&lt;/P&gt;

&lt;P&gt;I am trying to do this with regex. My regex works fine outside of Splunk e.g at regex101.com or in a powershell script, but I am not able to get it work in splunk.&lt;/P&gt;

&lt;P&gt;This is my regex: [^AD-].&lt;EM&gt;\s&lt;BR /&gt;&lt;BR /&gt;
But in splunk  | rex field="group" (?[^AD-].&lt;/EM&gt;\s) results in: Missing a search command before '^'.  ..... Error in 'SearchParser': errorcontext = [^AD-].*\s)}'.&lt;/P&gt;

&lt;P&gt;Udo&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2017 19:10:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/My-regex-is-not-working-in-Splunk-although-it-works-at-regex101/m-p/323052#M96405</guid>
      <dc:creator>ugruner</dc:creator>
      <dc:date>2017-12-06T19:10:25Z</dc:date>
    </item>
    <item>
      <title>Re: My regex is not working in Splunk although it works at regex101.com</title>
      <link>https://community.splunk.com/t5/Splunk-Search/My-regex-is-not-working-in-Splunk-although-it-works-at-regex101/m-p/323053#M96406</link>
      <description>&lt;P&gt;That's a great place to use the &lt;CODE&gt;replace&lt;/CODE&gt; command:&lt;BR /&gt;
&lt;CODE&gt;[your search] | replace "AD-*" with "*" in group&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Cleaner and easier than most regex!&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2017 19:31:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/My-regex-is-not-working-in-Splunk-although-it-works-at-regex101/m-p/323053#M96406</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2017-12-06T19:31:24Z</dc:date>
    </item>
    <item>
      <title>Re: My regex is not working in Splunk although it works at regex101.com</title>
      <link>https://community.splunk.com/t5/Splunk-Search/My-regex-is-not-working-in-Splunk-although-it-works-at-regex101/m-p/323054#M96407</link>
      <description>&lt;P&gt;to clarify , you have 1 field called group and the value of the field needs AD- stripped off ? &lt;/P&gt;

&lt;P&gt;ie: &lt;BR /&gt;
group = AD-test&lt;/P&gt;

&lt;P&gt;should be: &lt;/P&gt;

&lt;P&gt;group = test&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2017 20:16:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/My-regex-is-not-working-in-Splunk-although-it-works-at-regex101/m-p/323054#M96407</guid>
      <dc:creator>rphillips_splk</dc:creator>
      <dc:date>2017-12-06T20:16:01Z</dc:date>
    </item>
    <item>
      <title>Re: My regex is not working in Splunk although it works at regex101.com</title>
      <link>https://community.splunk.com/t5/Splunk-Search/My-regex-is-not-working-in-Splunk-although-it-works-at-regex101/m-p/323055#M96408</link>
      <description>&lt;P&gt;I would agree with @elliotproebstel !&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2017 20:25:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/My-regex-is-not-working-in-Splunk-although-it-works-at-regex101/m-p/323055#M96408</guid>
      <dc:creator>rphillips_splk</dc:creator>
      <dc:date>2017-12-06T20:25:51Z</dc:date>
    </item>
    <item>
      <title>Re: My regex is not working in Splunk although it works at regex101.com</title>
      <link>https://community.splunk.com/t5/Splunk-Search/My-regex-is-not-working-in-Splunk-although-it-works-at-regex101/m-p/323056#M96409</link>
      <description>&lt;P&gt;Thanks, I am always thinking too complicated.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2017 07:52:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/My-regex-is-not-working-in-Splunk-although-it-works-at-regex101/m-p/323056#M96409</guid>
      <dc:creator>ugruner</dc:creator>
      <dc:date>2017-12-07T07:52:29Z</dc:date>
    </item>
  </channel>
</rss>

