<?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: testing new regex in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/testing-new-regex/m-p/23113#M4079</link>
    <description>&lt;P&gt;Searching the internal index for regex extraction processor errors may  help too. Like so...&lt;/P&gt;

&lt;P&gt;index=_internal regexExtractionProcessor ERROR&lt;/P&gt;

&lt;P&gt;7:59:13.931 AM&lt;BR /&gt;&lt;BR /&gt;
07-30-2010 07:59:13.931 ERROR regexExtractionProcessor - Cannot compile RE "((.&lt;EM&gt;AcctCode=\d{5}-).&lt;/EM&gt;" for trade: missing )&lt;BR /&gt;
host=class4.splunk.com   Options|  sourcetype=splunkd   Options|  source=/home/rick4uc/opt/splunk/var/log/splunk/splunkd.log   Options&lt;/P&gt;</description>
    <pubDate>Fri, 30 Jul 2010 22:15:32 GMT</pubDate>
    <dc:creator>rroberts</dc:creator>
    <dc:date>2010-07-30T22:15:32Z</dc:date>
    <item>
      <title>testing new regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/testing-new-regex/m-p/23110#M4076</link>
      <description>&lt;P&gt;Before really putting my custom regex in transforms.conf, is there a quick way to test and debug it?&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jul 2010 21:41:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/testing-new-regex/m-p/23110#M4076</guid>
      <dc:creator>njathan</dc:creator>
      <dc:date>2010-07-30T21:41:28Z</dc:date>
    </item>
    <item>
      <title>Re: testing new regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/testing-new-regex/m-p/23111#M4077</link>
      <description>&lt;P&gt;Use the rex command: ..... | rex "" | .....,&lt;/P&gt;

&lt;P&gt;For example use the following regex to extract indexes.conf into the conf_file variable in the following event:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;05-21-2010 17:41:51.166 INFO  IndexProcessor - indexes.conf - memPoolMB param autotuned to 512MB
... | rex " - (?&amp;lt;conf_file&amp;gt;\w+\.conf) - "| .....
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 30 Jul 2010 21:54:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/testing-new-regex/m-p/23111#M4077</guid>
      <dc:creator>Ledion_Bitincka</dc:creator>
      <dc:date>2010-07-30T21:54:09Z</dc:date>
    </item>
    <item>
      <title>Re: testing new regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/testing-new-regex/m-p/23112#M4078</link>
      <description>&lt;P&gt;i assume you are talking about using the splunk command line, are you? how do i invoke the splunk command line? (sorry for sounding so n00by! installed splunk only yesterday &lt;span class="lia-unicode-emoji" title=":face_with_tongue:"&gt;😛&lt;/span&gt; )&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jul 2010 22:00:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/testing-new-regex/m-p/23112#M4078</guid>
      <dc:creator>njathan</dc:creator>
      <dc:date>2010-07-30T22:00:49Z</dc:date>
    </item>
    <item>
      <title>Re: testing new regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/testing-new-regex/m-p/23113#M4079</link>
      <description>&lt;P&gt;Searching the internal index for regex extraction processor errors may  help too. Like so...&lt;/P&gt;

&lt;P&gt;index=_internal regexExtractionProcessor ERROR&lt;/P&gt;

&lt;P&gt;7:59:13.931 AM&lt;BR /&gt;&lt;BR /&gt;
07-30-2010 07:59:13.931 ERROR regexExtractionProcessor - Cannot compile RE "((.&lt;EM&gt;AcctCode=\d{5}-).&lt;/EM&gt;" for trade: missing )&lt;BR /&gt;
host=class4.splunk.com   Options|  sourcetype=splunkd   Options|  source=/home/rick4uc/opt/splunk/var/log/splunk/splunkd.log   Options&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jul 2010 22:15:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/testing-new-regex/m-p/23113#M4079</guid>
      <dc:creator>rroberts</dc:creator>
      <dc:date>2010-07-30T22:15:32Z</dc:date>
    </item>
    <item>
      <title>Re: testing new regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/testing-new-regex/m-p/23114#M4080</link>
      <description>&lt;P&gt;@njathan - I was talking about testing the regex using the rex search command - either from splunk's search UI or CLI&lt;/P&gt;</description>
      <pubDate>Wed, 25 Aug 2010 06:24:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/testing-new-regex/m-p/23114#M4080</guid>
      <dc:creator>Ledion_Bitincka</dc:creator>
      <dc:date>2010-08-25T06:24:22Z</dc:date>
    </item>
    <item>
      <title>Re: testing new regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/testing-new-regex/m-p/23115#M4081</link>
      <description>&lt;P&gt;You may also want to look at &lt;A href="http://kodos.sourceforge.net/" rel="nofollow"&gt;Kodos&lt;/A&gt; (free) or &lt;A href="http://www.regexbuddy.com/" rel="nofollow"&gt;RegexBuddy&lt;/A&gt; (commercial).&lt;/P&gt;</description>
      <pubDate>Fri, 10 Sep 2010 23:30:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/testing-new-regex/m-p/23115#M4081</guid>
      <dc:creator>southeringtonp</dc:creator>
      <dc:date>2010-09-10T23:30:56Z</dc:date>
    </item>
    <item>
      <title>Re: testing new regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/testing-new-regex/m-p/23116#M4082</link>
      <description>&lt;P&gt;I usually use &lt;CODE&gt;$SPLUNK_HOME/bin/pcregextest&lt;/CODE&gt; on the Splunk command line because it uses the exact regex engine as comes with Splunk. The command line is somewhat inconvenient and you do have to make sure that you quote a few characters correctly according to shell quoting rules. (Please note that you need to quote characters when using &lt;CODE&gt;rex&lt;/CODE&gt; as well, and &lt;CODE&gt;rex&lt;/CODE&gt; quoting rules are an even worse headache. Furthermore, bash shell quoting is well-defined and completely documented.)&lt;/P&gt;</description>
      <pubDate>Fri, 10 Sep 2010 23:38:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/testing-new-regex/m-p/23116#M4082</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-09-10T23:38:59Z</dc:date>
    </item>
    <item>
      <title>Re: testing new regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/testing-new-regex/m-p/23117#M4083</link>
      <description>&lt;P&gt;I normally end up using Kodos for testing.  The only down side is that it uses Python regular expression syntax instead of pcre-style regular expressions.  The only difference I've see are:  (1) You have to add a &lt;CODE&gt;P&lt;/CODE&gt; in a capture group name, like:   &lt;CODE&gt;(?P&amp;lt;group&amp;gt;..)&lt;/CODE&gt; Of course, PCRE accepts both, so I often let the extra "P" in the final regex.  And (2), and python (and therefore Kodos) doesn't support atomic grouping or possessive quantifiers (like &lt;CODE&gt;\s++&lt;/CODE&gt;).  But this generally hasn't been too much of a problem since I don't often use these advanced regex these features.&lt;/P&gt;</description>
      <pubDate>Sat, 11 Sep 2010 00:27:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/testing-new-regex/m-p/23117#M4083</guid>
      <dc:creator>Lowell</dc:creator>
      <dc:date>2010-09-11T00:27:07Z</dc:date>
    </item>
    <item>
      <title>Re: testing new regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/testing-new-regex/m-p/23118#M4084</link>
      <description>&lt;P&gt;Good point about &lt;CODE&gt;rex&lt;/CODE&gt; and the quoting considerations.  Generally I've only hit issues when I have to match a literal &lt;CODE&gt;"&lt;/CODE&gt; (double-quote) character, but it's important to be aware that you can't always just copy and paste between a &lt;CODE&gt;rex&lt;/CODE&gt; command and a config file.&lt;/P&gt;</description>
      <pubDate>Sat, 11 Sep 2010 00:31:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/testing-new-regex/m-p/23118#M4084</guid>
      <dc:creator>Lowell</dc:creator>
      <dc:date>2010-09-11T00:31:23Z</dc:date>
    </item>
    <item>
      <title>Re: testing new regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/testing-new-regex/m-p/23119#M4085</link>
      <description>&lt;P&gt;Here's a quick way to test a regex in splunk by supplying test data via an eval, e.g. running a query like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=* | head 1 | eval testdata="123456a" | regex testdata="^.{5,6}(?&amp;lt;!p)a$" | stats count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The result is 1 if the regex matches and 0 if not. Change regex and testdata as appropriate&lt;/P&gt;</description>
      <pubDate>Sat, 23 Nov 2013 23:31:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/testing-new-regex/m-p/23119#M4085</guid>
      <dc:creator>tpflicke</dc:creator>
      <dc:date>2013-11-23T23:31:26Z</dc:date>
    </item>
    <item>
      <title>Re: testing new regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/testing-new-regex/m-p/23120#M4086</link>
      <description>&lt;P&gt;Splunk has included some very nice field extraction tools, but sometimes they don't work the way it's supposed to, you see it immediately when you send it to a tabular output (ie, table, stats, etc).  I just found the pcregextest command, so I'll have to try it out.&lt;/P&gt;

&lt;P&gt;David Maislin from Splunk clued me into &lt;A href="http://regex101.com"&gt;regex101.com&lt;/A&gt; recently and I've used it heavily.  It's the best regex tool that I've found.  Try it out and let me know if you've found anything better.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Feb 2015 21:42:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/testing-new-regex/m-p/23120#M4086</guid>
      <dc:creator>sherm77</dc:creator>
      <dc:date>2015-02-04T21:42:27Z</dc:date>
    </item>
  </channel>
</rss>

