<?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: Rex on an extracted field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Rex-on-an-extracted-field/m-p/80896#M20437</link>
    <description>&lt;P&gt;I don't have an install here right now to check the interface so I can't think what fields you get in the gui. Normally what I would have done would be to put it into my transforms.conf as a search time extraction.&lt;/P&gt;

&lt;P&gt;example inside transforms.conf&lt;BR /&gt;
[cluster_name_extraction]&lt;BR /&gt;
SOURCE_KEY = host&lt;BR /&gt;
REGEX = ^(D+).&lt;BR /&gt;
FORMAT = cluster_name::$1&lt;/P&gt;

&lt;P&gt;You'd then make a reference to it in your props.conf under your particular sourcetype definition&lt;/P&gt;

&lt;P&gt;REPORT-cluster_name_extraction = cluster_name_extraction&lt;/P&gt;

&lt;P&gt;More info here : &lt;A href="http://docs.splunk.com/Documentation/Splunk/4.3.4/admin/Transformsconf" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/4.3.4/admin/Transformsconf&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;So perhaps some of those options above exist in the gui also (i'll check later if you hadn't seen this already and i'll update this answer).&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 12:34:40 GMT</pubDate>
    <dc:creator>Lucas_K</dc:creator>
    <dc:date>2020-09-28T12:34:40Z</dc:date>
    <item>
      <title>Rex on an extracted field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-on-an-extracted-field/m-p/80891#M20432</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;

&lt;P&gt;I'm trying to extract the cluster name of my servers using the host name. So we have something like host=clusterx01.abc.com, host=clusterx02.abc.com, host=clusterx03.abc.com. I would like to extract the "cluster" part and leave out everything after that out. This would normally be easy if the hostname was in the _rawfield but it's not, and setting the rex field to host is not working. Also, erex is not helping. It keeps inclding the first zero in the hostname.&lt;/P&gt;

&lt;P&gt;Any thoughts on how I can use rex on a field that is created on index time?&lt;/P&gt;

&lt;P&gt;Thanks!!&lt;/P&gt;</description>
      <pubDate>Fri, 05 Oct 2012 00:02:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-on-an-extracted-field/m-p/80891#M20432</guid>
      <dc:creator>romantercero</dc:creator>
      <dc:date>2012-10-05T00:02:25Z</dc:date>
    </item>
    <item>
      <title>Re: Rex on an extracted field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-on-an-extracted-field/m-p/80892#M20433</link>
      <description>&lt;P&gt;It should work with indexed fields fine just like any other field. &lt;BR /&gt;
ie. rex field=host "^(?P&lt;CLUSTERNAME&gt;\w+)." thats the first section of the name.&lt;/CLUSTERNAME&gt;&lt;/P&gt;

&lt;P&gt;just modify the rex to remove the numbers off the end. ahla ^(?P&lt;CLUSTERNAME&gt;\w+)\d\d.   &lt;/CLUSTERNAME&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Oct 2012 02:02:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-on-an-extracted-field/m-p/80892#M20433</guid>
      <dc:creator>Lucas_K</dc:creator>
      <dc:date>2012-10-05T02:02:03Z</dc:date>
    </item>
    <item>
      <title>Re: Rex on an extracted field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-on-an-extracted-field/m-p/80893#M20434</link>
      <description>&lt;P&gt;I was actually trying rex field=host "(?&lt;CLUSTER_NAME&gt;\D+)" as that had worked in the past but it was not working when the data was not in the _raw field. I tried your suggestion and YES! It worked &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; I tried what I was doing before and that also works now : / maybe a I had a typo somewhere and retyping everything must have fixed it.&lt;/CLUSTER_NAME&gt;&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 05 Oct 2012 17:39:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-on-an-extracted-field/m-p/80893#M20434</guid>
      <dc:creator>romantercero</dc:creator>
      <dc:date>2012-10-05T17:39:36Z</dc:date>
    </item>
    <item>
      <title>Re: Rex on an extracted field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-on-an-extracted-field/m-p/80894#M20435</link>
      <description>&lt;P&gt;Ok, followup question: How would I save my "field=host (?&lt;CLUSTER_NAME&gt;\D+)" extraction in the field extractions sections on the management page? It's not working. I have a few hunches about why but no workaround so far &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt; any toughs?&lt;/CLUSTER_NAME&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Oct 2012 19:35:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-on-an-extracted-field/m-p/80894#M20435</guid>
      <dc:creator>romantercero</dc:creator>
      <dc:date>2012-10-05T19:35:05Z</dc:date>
    </item>
    <item>
      <title>Re: Rex on an extracted field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-on-an-extracted-field/m-p/80895#M20436</link>
      <description>&lt;P&gt;I don't have an install here right now to check the interface so I can't think what fields you get in the gui. Normally what I would have done would be to put it into my transforms.conf as a search time extraction (not enough characters available to put it here &lt;span class="lia-unicode-emoji" title=":neutral_face:"&gt;😐&lt;/span&gt; )&lt;/P&gt;</description>
      <pubDate>Fri, 05 Oct 2012 21:58:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-on-an-extracted-field/m-p/80895#M20436</guid>
      <dc:creator>Lucas_K</dc:creator>
      <dc:date>2012-10-05T21:58:07Z</dc:date>
    </item>
    <item>
      <title>Re: Rex on an extracted field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-on-an-extracted-field/m-p/80896#M20437</link>
      <description>&lt;P&gt;I don't have an install here right now to check the interface so I can't think what fields you get in the gui. Normally what I would have done would be to put it into my transforms.conf as a search time extraction.&lt;/P&gt;

&lt;P&gt;example inside transforms.conf&lt;BR /&gt;
[cluster_name_extraction]&lt;BR /&gt;
SOURCE_KEY = host&lt;BR /&gt;
REGEX = ^(D+).&lt;BR /&gt;
FORMAT = cluster_name::$1&lt;/P&gt;

&lt;P&gt;You'd then make a reference to it in your props.conf under your particular sourcetype definition&lt;/P&gt;

&lt;P&gt;REPORT-cluster_name_extraction = cluster_name_extraction&lt;/P&gt;

&lt;P&gt;More info here : &lt;A href="http://docs.splunk.com/Documentation/Splunk/4.3.4/admin/Transformsconf" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/4.3.4/admin/Transformsconf&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;So perhaps some of those options above exist in the gui also (i'll check later if you hadn't seen this already and i'll update this answer).&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:34:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-on-an-extracted-field/m-p/80896#M20437</guid>
      <dc:creator>Lucas_K</dc:creator>
      <dc:date>2020-09-28T12:34:40Z</dc:date>
    </item>
    <item>
      <title>Re: Rex on an extracted field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-on-an-extracted-field/m-p/80897#M20438</link>
      <description>&lt;P&gt;That's interesting. I had though of index time extractions but stopped after realizing that other fields extracted at this time would most probably not be available for me to base an extraction on them. I think you found another way to tackle this issue. Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 09 Oct 2012 19:02:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-on-an-extracted-field/m-p/80897#M20438</guid>
      <dc:creator>romantercero</dc:creator>
      <dc:date>2012-10-09T19:02:05Z</dc:date>
    </item>
    <item>
      <title>Re: Rex on an extracted field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-on-an-extracted-field/m-p/80898#M20439</link>
      <description>&lt;P&gt;I think Splunk best practice is to make your extractions search time and not index time. I believe the reasoning behind this is that your understanding of the data can and most likely will change in the future. &lt;/P&gt;

&lt;P&gt;By having your fields extracted at search time you are not stuck with bad decisions made when initially onboarding the data.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Oct 2012 22:19:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-on-an-extracted-field/m-p/80898#M20439</guid>
      <dc:creator>Lucas_K</dc:creator>
      <dc:date>2012-10-09T22:19:44Z</dc:date>
    </item>
  </channel>
</rss>

