<?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: Index time field extraction: regexp issue in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Index-time-field-extraction-regexp-issue/m-p/180670#M52046</link>
    <description>&lt;P&gt;and now we know why your original regex wasn't working... &lt;BR /&gt;
Always a good idea to test inline with the &lt;CODE&gt;rex&lt;/CODE&gt; command&lt;/P&gt;

&lt;P&gt;...|rex field=whatever "yourregex"|head 10|table yourfield&lt;/P&gt;</description>
    <pubDate>Wed, 06 May 2015 23:11:24 GMT</pubDate>
    <dc:creator>rsennett_splunk</dc:creator>
    <dc:date>2015-05-06T23:11:24Z</dc:date>
    <item>
      <title>Index time field extraction: regexp issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Index-time-field-extraction-regexp-issue/m-p/180640#M52016</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;Since I often search a specific expression in a large set of events, I would like to index it.&lt;/P&gt;

&lt;P&gt;Every single instance that I am running has the following format:&lt;BR /&gt;
instance-name.generic-name.subdomaine.domain.com&lt;/P&gt;

&lt;P&gt;In this expression, only domain.com is static and will never change.&lt;BR /&gt;
I would like to extract generic-name for all of my events. &lt;/P&gt;

&lt;P&gt;&lt;EM&gt;props.conf&lt;/EM&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[generic-name]
TRANSFORMS-generic-name = generic-name
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;EM&gt;transforms.conf&lt;/EM&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[generic-name]

REGEX = (?&amp;amp;lt;instancename&amp;amp;gt;[^\.]+)\.(?&amp;amp;lt;gname&amp;amp;gt;[^\.]+)\.(?&amp;amp;lt;subdomain&amp;amp;gt;[^\.]+)\.(?&amp;amp;lt;domain&amp;amp;gt;[^\.]+)\.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;EM&gt;fields.conf&lt;/EM&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[gname]
INDEXED = True
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I am wondering if the fact that I am not receiving anything in the Splunk dashboard is coming from my configuration file or my regular expression ?&lt;BR /&gt;
Thank you in advance for your help&lt;/P&gt;

&lt;P&gt;Update: I have tried all the following regexp and there is still no result. I don't receive any data in my sourcetype.&lt;/P&gt;</description>
      <pubDate>Mon, 04 May 2015 20:34:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Index-time-field-extraction-regexp-issue/m-p/180640#M52016</guid>
      <dc:creator>Super_Knulps</dc:creator>
      <dc:date>2015-05-04T20:34:11Z</dc:date>
    </item>
    <item>
      <title>Re: Index time field extraction: regexp issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Index-time-field-extraction-regexp-issue/m-p/180641#M52017</link>
      <description>&lt;P&gt;Are you sure you need indexed extractions here?&lt;/P&gt;

&lt;P&gt;What happens when you run this search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=foo sourcetype=generic-name gname=some-gname
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is the scanCount in the job inspector higher than the resultCount?&lt;/P&gt;</description>
      <pubDate>Mon, 04 May 2015 21:03:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Index-time-field-extraction-regexp-issue/m-p/180641#M52017</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2015-05-04T21:03:47Z</dc:date>
    </item>
    <item>
      <title>Re: Index time field extraction: regexp issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Index-time-field-extraction-regexp-issue/m-p/180642#M52018</link>
      <description>&lt;P&gt;It is your REGEX; try this one:&lt;BR /&gt;
(?&amp;lt;instancename&amp;gt;[^/.]+)/.(?&amp;lt;gname&amp;gt;[^/.]+)/.(?&amp;lt;subdomain&amp;gt;[^/.]+)/.(?&amp;lt;domain&amp;gt;[^/.]+)&lt;/P&gt;</description>
      <pubDate>Mon, 04 May 2015 21:20:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Index-time-field-extraction-regexp-issue/m-p/180642#M52018</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-05-04T21:20:41Z</dc:date>
    </item>
    <item>
      <title>Re: Index time field extraction: regexp issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Index-time-field-extraction-regexp-issue/m-p/180643#M52019</link>
      <description>&lt;P&gt;Thank you for your answer. Yes I am pretty sure that I need indexed extractions here since I am running the equivalence of gname=foo on every single search I do. Anyway, I will compare the performance before and after my change.&lt;/P&gt;

&lt;P&gt;When I run this:&lt;BR /&gt;
index=foo sourcetype=generic-name gname=some-gname&lt;BR /&gt;
I got: No Results Found. Even with sourcetype=generic-name only and gname=some-gname only.&lt;/P&gt;

&lt;P&gt;scanCount=0 resultCount=0.&lt;/P&gt;

&lt;P&gt;I am wondering if the host is part of the data. Is the host part of the data that I can extract ? Or maybe it is just my regexp. &lt;/P&gt;</description>
      <pubDate>Mon, 04 May 2015 21:36:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Index-time-field-extraction-regexp-issue/m-p/180643#M52019</guid>
      <dc:creator>Super_Knulps</dc:creator>
      <dc:date>2015-05-04T21:36:04Z</dc:date>
    </item>
    <item>
      <title>Re: Index time field extraction: regexp issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Index-time-field-extraction-regexp-issue/m-p/180644#M52020</link>
      <description>&lt;P&gt;You are missing some parts in your regex:&lt;/P&gt;

&lt;P&gt;YOURS: (capturing group not capturing anything, just naming the field): &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[^\.]+\.(?&amp;lt;gname&amp;gt;)[^\.]\.domain\.com
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;MINE:  (capturing group now contains the generic segment):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[^\.]+\.(?&amp;lt;gname&amp;gt;[^\.]+)\.[^\.]+\..+
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;in case it's not clear... here is the segment zoomed in - note the closing paren, and without the + you get the directive once... not one or more:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;yours: (?&amp;lt;gname&amp;gt;)[^\.]

mine:  (?&amp;lt;gname&amp;gt;[^\.]+)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 04 May 2015 22:13:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Index-time-field-extraction-regexp-issue/m-p/180644#M52020</guid>
      <dc:creator>rsennett_splunk</dc:creator>
      <dc:date>2015-05-04T22:13:24Z</dc:date>
    </item>
    <item>
      <title>Re: Index time field extraction: regexp issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Index-time-field-extraction-regexp-issue/m-p/180645#M52021</link>
      <description>&lt;P&gt;If you're trying to search on a part of the host you could do this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=foo sourcetype=generic-name host=*.some-gname.*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Should be pretty quick in terms of identifying the right events because host already is indexed. Loading the events is a different matter of course, so look at scanCount vs eventCount to check if your search is well-targeted or not.&lt;/P&gt;</description>
      <pubDate>Mon, 04 May 2015 22:16:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Index-time-field-extraction-regexp-issue/m-p/180645#M52021</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2015-05-04T22:16:03Z</dc:date>
    </item>
    <item>
      <title>Re: Index time field extraction: regexp issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Index-time-field-extraction-regexp-issue/m-p/180646#M52022</link>
      <description>&lt;P&gt;If that's good in terms of scanCount vs resultCount and you want to get rid of the ugly &lt;CODE&gt;host=*.some-gname.*&lt;/CODE&gt; you can do this field extraction:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;amp;lt;some regex&amp;amp;gt; in host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That'll extract your gname from the host field to let you search using &lt;CODE&gt;gname=some-gname&lt;/CODE&gt; backed by the host field.&lt;/P&gt;</description>
      <pubDate>Mon, 04 May 2015 22:19:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Index-time-field-extraction-regexp-issue/m-p/180646#M52022</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2015-05-04T22:19:20Z</dc:date>
    </item>
    <item>
      <title>Re: Index time field extraction: regexp issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Index-time-field-extraction-regexp-issue/m-p/180647#M52023</link>
      <description>&lt;P&gt;You are talking about search time extraction while I am asking for index time. &lt;/P&gt;</description>
      <pubDate>Mon, 04 May 2015 23:20:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Index-time-field-extraction-regexp-issue/m-p/180647#M52023</guid>
      <dc:creator>Super_Knulps</dc:creator>
      <dc:date>2015-05-04T23:20:42Z</dc:date>
    </item>
    <item>
      <title>Re: Index time field extraction: regexp issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Index-time-field-extraction-regexp-issue/m-p/180648#M52024</link>
      <description>&lt;P&gt;Thank you for your answer!&lt;BR /&gt;
I am still not receiving any result from your search. &lt;BR /&gt;
Actually I have also tried it on regexpr.com and you are matching everything with your regexp. &lt;BR /&gt;
Maybe I am missing something but it does not seem to work. &lt;/P&gt;</description>
      <pubDate>Mon, 04 May 2015 23:23:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Index-time-field-extraction-regexp-issue/m-p/180648#M52024</guid>
      <dc:creator>Super_Knulps</dc:creator>
      <dc:date>2015-05-04T23:23:35Z</dc:date>
    </item>
    <item>
      <title>Re: Index time field extraction: regexp issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Index-time-field-extraction-regexp-issue/m-p/180649#M52025</link>
      <description>&lt;P&gt;Thank you for your answer.&lt;BR /&gt;
Your regexp looks good and easy to understand but maybe slower due to multiple extraction. &lt;BR /&gt;
Anyway, I still receive no data when I am trying to use yours. Am I missing something else somewhere ? &lt;/P&gt;</description>
      <pubDate>Tue, 05 May 2015 00:20:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Index-time-field-extraction-regexp-issue/m-p/180649#M52025</guid>
      <dc:creator>Super_Knulps</dc:creator>
      <dc:date>2015-05-05T00:20:06Z</dc:date>
    </item>
    <item>
      <title>Re: Index time field extraction: regexp issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Index-time-field-extraction-regexp-issue/m-p/180650#M52026</link>
      <description>&lt;P&gt;See my answer. You were missing an actual extraction. Your capturing group surrounded only the field name... so nothing was being captured. You're also representing only one iteration of "anything that is not a dot" because you were missing the + which says "Everything that is not a dot, until you hit the dot". Whether you grab all the fields, or put literals in the domain and sub domain it doesn't matter as long as you are actually capturing something. As for "Slower" as long as you are moving forward (and not doing lookbacks) speed isn't an issue.&lt;/P&gt;</description>
      <pubDate>Tue, 05 May 2015 03:09:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Index-time-field-extraction-regexp-issue/m-p/180650#M52026</guid>
      <dc:creator>rsennett_splunk</dc:creator>
      <dc:date>2015-05-05T03:09:19Z</dc:date>
    </item>
    <item>
      <title>Re: Index time field extraction: regexp issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Index-time-field-extraction-regexp-issue/m-p/180651#M52027</link>
      <description>&lt;P&gt;try regex101.com that will show you what you are capturing and what you are not. It also will walk you through the regex.  you can see it working click &lt;A href="https://regex101.com/r/zH0tS1/1"&gt;here&lt;/A&gt;:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://regex101.com/r/zH0tS1/1"&gt;https://regex101.com/r/zH0tS1/1&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 May 2015 03:12:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Index-time-field-extraction-regexp-issue/m-p/180651#M52027</guid>
      <dc:creator>rsennett_splunk</dc:creator>
      <dc:date>2015-05-05T03:12:10Z</dc:date>
    </item>
    <item>
      <title>Re: Index time field extraction: regexp issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Index-time-field-extraction-regexp-issue/m-p/180652#M52028</link>
      <description>&lt;P&gt;I know. I'm questioning whether indexed extractions are the right tool for the job.&lt;/P&gt;

&lt;P&gt;Set this in props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[your_sourcetype]
...
EXTRACT-gname = ^[^.]+\.(?&amp;amp;lt;gname&amp;amp;gt;[^.]+) in host`
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;See if that works, and see if that selects the correct events (scanCount vs resultCount).&lt;/P&gt;</description>
      <pubDate>Tue, 05 May 2015 16:42:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Index-time-field-extraction-regexp-issue/m-p/180652#M52028</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2015-05-05T16:42:57Z</dc:date>
    </item>
    <item>
      <title>Re: Index time field extraction: regexp issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Index-time-field-extraction-regexp-issue/m-p/180653#M52029</link>
      <description>&lt;P&gt;You need to swap the frontslashes for backslashes (stinking broken markdown).  It does work; I tested it.  It is important to include the other portions (but you don't necessarily have to capture them into fields) because otherwise your single capture will be capturing things you do not intend.&lt;/P&gt;</description>
      <pubDate>Tue, 05 May 2015 16:54:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Index-time-field-extraction-regexp-issue/m-p/180653#M52029</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-05-05T16:54:11Z</dc:date>
    </item>
    <item>
      <title>Re: Index time field extraction: regexp issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Index-time-field-extraction-regexp-issue/m-p/180654#M52030</link>
      <description>&lt;P&gt;Okay thank you, both of your regexp woocock and rsenett_splunk are matching what I want, which is perfect. &lt;BR /&gt;
However, I still don't receive anything in the dashboard. The sourcetype is fine in the license. I have updated my first post with your regex: it is all up to date.&lt;/P&gt;</description>
      <pubDate>Tue, 05 May 2015 22:10:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Index-time-field-extraction-regexp-issue/m-p/180654#M52030</guid>
      <dc:creator>Super_Knulps</dc:creator>
      <dc:date>2015-05-05T22:10:17Z</dc:date>
    </item>
    <item>
      <title>Re: Index time field extraction: regexp issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Index-time-field-extraction-regexp-issue/m-p/180655#M52031</link>
      <description>&lt;P&gt;Post your dashboard xml.&lt;/P&gt;</description>
      <pubDate>Tue, 05 May 2015 23:22:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Index-time-field-extraction-regexp-issue/m-p/180655#M52031</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-05-05T23:22:13Z</dc:date>
    </item>
    <item>
      <title>Re: Index time field extraction: regexp issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Index-time-field-extraction-regexp-issue/m-p/180656#M52032</link>
      <description>&lt;P&gt;I am just using the search: "sourcetype=generic-name gname=foo", in my Splunk App.&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2015 16:29:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Index-time-field-extraction-regexp-issue/m-p/180656#M52032</guid>
      <dc:creator>Super_Knulps</dc:creator>
      <dc:date>2015-05-06T16:29:24Z</dc:date>
    </item>
    <item>
      <title>Re: Index time field extraction: regexp issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Index-time-field-extraction-regexp-issue/m-p/180657#M52033</link>
      <description>&lt;P&gt;This is probably the problem:&lt;BR /&gt;
&lt;A href="http://blogs.splunk.com/2011/10/07/cannot-search-based-on-an-extracted-field/"&gt;http://blogs.splunk.com/2011/10/07/cannot-search-based-on-an-extracted-field/&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Try this search instead:&lt;BR /&gt;
sourcetype=generic-name gname=* | search gname="foo"&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2015 16:39:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Index-time-field-extraction-regexp-issue/m-p/180657#M52033</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-05-06T16:39:45Z</dc:date>
    </item>
    <item>
      <title>Re: Index time field extraction: regexp issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Index-time-field-extraction-regexp-issue/m-p/180658#M52034</link>
      <description>&lt;P&gt;My problem is different: in the link you gave me, sourcetype=generic-name gname=* should give results which is not my case. I litteraly get nothing. &lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2015 17:18:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Index-time-field-extraction-regexp-issue/m-p/180658#M52034</guid>
      <dc:creator>Super_Knulps</dc:creator>
      <dc:date>2015-05-06T17:18:03Z</dc:date>
    </item>
    <item>
      <title>Re: Index time field extraction: regexp issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Index-time-field-extraction-regexp-issue/m-p/180659#M52035</link>
      <description>&lt;P&gt;I think there is some confusion about exactly what your problem is.&lt;BR /&gt;
Your question says... you often search for an expression like:&lt;BR /&gt;
&lt;CODE&gt;instance-name.generic-name.subdomain.domain.com&lt;/CODE&gt;&lt;BR /&gt;
I think some folks here have assumed that this is found the &lt;CODE&gt;host&lt;/CODE&gt;. I didn't get that from what you've said. &lt;/P&gt;

&lt;P&gt;Also, you're giving us the text and we're giving you legitimate working regexes and still you're getting nothing. So it would be a good idea if you posted a couple of events that contain the values you're looking for so we can see what might be going wrong. &lt;/P&gt;

&lt;P&gt;Also... see my edited answer that addresses your transforms.conf syntax&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2015 18:32:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Index-time-field-extraction-regexp-issue/m-p/180659#M52035</guid>
      <dc:creator>rsennett_splunk</dc:creator>
      <dc:date>2015-05-06T18:32:29Z</dc:date>
    </item>
  </channel>
</rss>

