<?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 Why isn't this regex returning anything? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-this-regex-returning-anything/m-p/111002#M29054</link>
    <description>&lt;P&gt;When running the regex below, the search doesn't return any results even though the reg ex string works well on the  external regex builder I use. Help.&lt;/P&gt;

&lt;P&gt;Here's the original string: &lt;CODE&gt;\.(.{2,4}\s+?)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Here's the spunk search: &lt;CODE&gt;index=*|fields file | rex field=file "(?\.(.{2,4}\s+?))" | stats count(Asset) AS "Total" by Asset | sort -Total&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 11 Nov 2014 22:50:21 GMT</pubDate>
    <dc:creator>ashnet16</dc:creator>
    <dc:date>2014-11-11T22:50:21Z</dc:date>
    <item>
      <title>Why isn't this regex returning anything?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-this-regex-returning-anything/m-p/111002#M29054</link>
      <description>&lt;P&gt;When running the regex below, the search doesn't return any results even though the reg ex string works well on the  external regex builder I use. Help.&lt;/P&gt;

&lt;P&gt;Here's the original string: &lt;CODE&gt;\.(.{2,4}\s+?)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Here's the spunk search: &lt;CODE&gt;index=*|fields file | rex field=file "(?\.(.{2,4}\s+?))" | stats count(Asset) AS "Total" by Asset | sort -Total&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Nov 2014 22:50:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-this-regex-returning-anything/m-p/111002#M29054</guid>
      <dc:creator>ashnet16</dc:creator>
      <dc:date>2014-11-11T22:50:21Z</dc:date>
    </item>
    <item>
      <title>Re: Why isn't this regex returning anything?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-this-regex-returning-anything/m-p/111003#M29055</link>
      <description>&lt;P&gt;Could you provide some of your RAW data? The content of field "file" should be enough.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Nov 2014 22:52:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-this-regex-returning-anything/m-p/111003#M29055</guid>
      <dc:creator>musskopf</dc:creator>
      <dc:date>2014-11-11T22:52:57Z</dc:date>
    </item>
    <item>
      <title>Re: Why isn't this regex returning anything?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-this-regex-returning-anything/m-p/111004#M29056</link>
      <description>&lt;P&gt;The first error is here:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;(?&lt;/STRONG&gt;.(.{2,4}s+?)&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;you have &lt;CODE&gt;(?&lt;/CODE&gt; and &lt;CODE&gt;)&lt;/CODE&gt; at the start and end... that doesn't look right.&lt;/P&gt;

&lt;P&gt;Also, to use the &lt;CODE&gt;rex&lt;/CODE&gt; command, you need to use Named Capturing group in the regex, like: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;.(?P&amp;lt;test&amp;gt;.+)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Where &lt;STRONG&gt;test&lt;/STRONG&gt; will be the name of the field extracted.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Nov 2014 22:56:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-this-regex-returning-anything/m-p/111004#M29056</guid>
      <dc:creator>musskopf</dc:creator>
      <dc:date>2014-11-11T22:56:48Z</dc:date>
    </item>
    <item>
      <title>Re: Why isn't this regex returning anything?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-this-regex-returning-anything/m-p/111005#M29057</link>
      <description>&lt;P&gt;Here is some raw data:&lt;/P&gt;

&lt;P&gt;vcard.png&lt;BR /&gt;
phone.png&lt;BR /&gt;&lt;BR /&gt;
style.css&lt;BR /&gt;&lt;BR /&gt;
jquery.colorbox-min.js&lt;/P&gt;

&lt;P&gt;Thanks!!&lt;/P&gt;</description>
      <pubDate>Tue, 11 Nov 2014 22:58:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-this-regex-returning-anything/m-p/111005#M29057</guid>
      <dc:creator>ashnet16</dc:creator>
      <dc:date>2014-11-11T22:58:12Z</dc:date>
    </item>
    <item>
      <title>Re: Why isn't this regex returning anything?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-this-regex-returning-anything/m-p/111006#M29058</link>
      <description>&lt;P&gt;Ok, and is that a single line? or multiple entries? Also, what are you trying to extract?&lt;/P&gt;</description>
      <pubDate>Tue, 11 Nov 2014 23:00:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-this-regex-returning-anything/m-p/111006#M29058</guid>
      <dc:creator>musskopf</dc:creator>
      <dc:date>2014-11-11T23:00:03Z</dc:date>
    </item>
    <item>
      <title>Re: Why isn't this regex returning anything?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-this-regex-returning-anything/m-p/111007#M29059</link>
      <description>&lt;P&gt;This is the Splunk search Format for rex:  (?...)   (.....)equals the regular expression. &lt;/P&gt;</description>
      <pubDate>Tue, 11 Nov 2014 23:01:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-this-regex-returning-anything/m-p/111007#M29059</guid>
      <dc:creator>ashnet16</dc:creator>
      <dc:date>2014-11-11T23:01:28Z</dc:date>
    </item>
    <item>
      <title>Re: Why isn't this regex returning anything?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-this-regex-returning-anything/m-p/111008#M29060</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;please provide real data, &lt;BR /&gt;
describe what you are trying to achieve, &lt;BR /&gt;
use the &lt;CODE&gt;code&lt;/CODE&gt; markup where appropriate, since this help with formatting and special characters&lt;/P&gt;

&lt;P&gt;If you got a good answer, vote up a/o mark as answered.&lt;/P&gt;

&lt;P&gt;/K&lt;/P&gt;</description>
      <pubDate>Wed, 12 Nov 2014 07:49:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-this-regex-returning-anything/m-p/111008#M29060</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2014-11-12T07:49:45Z</dc:date>
    </item>
    <item>
      <title>Re: Why isn't this regex returning anything?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-this-regex-returning-anything/m-p/111009#M29061</link>
      <description>&lt;P&gt;Hi ashnet16,&lt;/P&gt;

&lt;P&gt;As Kristian says, we need some real data and also exactly what you try to extract from that data.&lt;BR /&gt;&lt;BR /&gt;
With that said, your original rex  &lt;CODE&gt;| rex field=file "(?\.(.{2,4}\s+?))"&lt;/CODE&gt; does not look right. &lt;/P&gt;

&lt;P&gt;If you want to convert your original regular expression &lt;CODE&gt;\.(.{2,4}\s+?)&lt;/CODE&gt; to rex, I would expect it to look something like this: &lt;/P&gt;

&lt;P&gt;| rex field=file ".(?&amp;lt;fieldname&amp;gt;.{2,4}\s+?)"&lt;/P&gt;

&lt;P&gt;Cheers!&lt;/P&gt;

&lt;P&gt;#Sven Emil&lt;/P&gt;</description>
      <pubDate>Wed, 12 Nov 2014 08:08:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-this-regex-returning-anything/m-p/111009#M29061</guid>
      <dc:creator>sves</dc:creator>
      <dc:date>2014-11-12T08:08:02Z</dc:date>
    </item>
  </channel>
</rss>

