<?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: Can you extract from a field that was extracted in the same stanza? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Can-you-extract-from-a-field-that-was-extracted-in-the-same/m-p/324864#M96894</link>
    <description>&lt;P&gt;Actually scratch that.  The original config started working for me, which I put down to the reload=true, but if I then add a third line extracting a field from within metric_test it still doesn't appear, whereas if I add it based on _raw it does.&lt;/P&gt;

&lt;P&gt;I wonder if something is required to make Splunk aware that it can use metric_test as the source field.&lt;/P&gt;</description>
    <pubDate>Fri, 02 Jun 2017 13:13:05 GMT</pubDate>
    <dc:creator>sillingworth</dc:creator>
    <dc:date>2017-06-02T13:13:05Z</dc:date>
    <item>
      <title>Can you extract from a field that was extracted in the same stanza?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-extract-from-a-field-that-was-extracted-in-the-same/m-p/324858#M96888</link>
      <description>&lt;P&gt;Using the docs here: &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.5.2/Admin/Propsconf" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/6.5.2/Admin/Propsconf&lt;/A&gt;, specifically this section:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;* Use '&amp;lt;regex&amp;gt; in &amp;lt;src_field&amp;gt;' to match the regex against the values of a
  specific field.  Otherwise it just matches against _raw (all raw event
  data).
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I came up with this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;EXTRACT-metric_parts = : (&amp;lt;metric type=".*?" name=")?(?&amp;lt;metric_path&amp;gt;.*?):(?&amp;lt;metric_name&amp;gt;.*?)[="]( value=")?(?&amp;lt;value&amp;gt;.*?)[" ]
EXTRACT-test = (?&amp;lt;metric_test&amp;gt;.*) in metric_path
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;All the field extractions in metric_parts work fine, but metric_test doesn't appear (it should be a duplicate of metric_path, according to my understanding of the readme).&lt;/P&gt;

&lt;P&gt;Is there a limitation I'm missing here?  Can src_field only be one of the automatic fields like source?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 14:17:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-extract-from-a-field-that-was-extracted-in-the-same/m-p/324858#M96888</guid>
      <dc:creator>sillingworth</dc:creator>
      <dc:date>2020-09-29T14:17:58Z</dc:date>
    </item>
    <item>
      <title>Re: Can you extract from a field that was extracted in the same stanza?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-extract-from-a-field-that-was-extracted-in-the-same/m-p/324859#M96889</link>
      <description>&lt;P&gt;Though the documentation doesn't state this, I wonder if  only works for indexed fields.  Try setting it to &lt;CODE&gt;source&lt;/CODE&gt; and see if that gives any results.&lt;/P&gt;

&lt;P&gt;If that's the issue, you can use a transform and make use of the &lt;CODE&gt;SOURCE_KEY&lt;/CODE&gt; directive instead to accomplish what you want.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2017 14:27:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-extract-from-a-field-that-was-extracted-in-the-same/m-p/324859#M96889</guid>
      <dc:creator>micahkemp</dc:creator>
      <dc:date>2017-06-01T14:27:29Z</dc:date>
    </item>
    <item>
      <title>Re: Can you extract from a field that was extracted in the same stanza?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-extract-from-a-field-that-was-extracted-in-the-same/m-p/324860#M96890</link>
      <description>&lt;P&gt;Switch from &lt;CODE&gt;Extract&lt;/CODE&gt; to &lt;CODE&gt;Report&lt;/CODE&gt; in props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;REPORT-ArbitraryButUniqueStringHere = metric_parts, test
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then in transforms.conf this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[metric_parts]
REGEX = (&amp;lt;metric type=".*?" name=")?(?&amp;lt;metric_path&amp;gt;.*?):(?&amp;lt;metric_name&amp;gt;.*?)[="]( value=")?(?&amp;lt;value&amp;gt;.*?)[" ]
[test]
SOURCE_KEY = metric_path
REGEX = (?&amp;lt;metric_test&amp;gt;.*)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 Jun 2017 20:24:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-extract-from-a-field-that-was-extracted-in-the-same/m-p/324860#M96890</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-06-01T20:24:09Z</dc:date>
    </item>
    <item>
      <title>Re: Can you extract from a field that was extracted in the same stanza?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-extract-from-a-field-that-was-extracted-in-the-same/m-p/324861#M96891</link>
      <description>&lt;P&gt;It appears that you need it named twice so you can use &lt;CODE&gt;fieldalias&lt;/CODE&gt; for that:&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Knowledge/Addaliasestofields"&gt;https://docs.splunk.com/Documentation/Splunk/latest/Knowledge/Addaliasestofields&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2017 20:26:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-extract-from-a-field-that-was-extracted-in-the-same/m-p/324861#M96891</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-06-01T20:26:29Z</dc:date>
    </item>
    <item>
      <title>Re: Can you extract from a field that was extracted in the same stanza?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-extract-from-a-field-that-was-extracted-in-the-same/m-p/324862#M96892</link>
      <description>&lt;P&gt;The extractions in the question are actually correct, but it seems a full refresh isn't enough to pull in the updated props.conf (I have no idea why).&lt;/P&gt;

&lt;P&gt;Sticking &lt;CODE&gt;| extract reload=true&lt;/CODE&gt; on the end of my search revealed the new fields.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2017 11:39:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-extract-from-a-field-that-was-extracted-in-the-same/m-p/324862#M96892</guid>
      <dc:creator>sillingworth</dc:creator>
      <dc:date>2017-06-02T11:39:09Z</dc:date>
    </item>
    <item>
      <title>Re: Can you extract from a field that was extracted in the same stanza?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-extract-from-a-field-that-was-extracted-in-the-same/m-p/324863#M96893</link>
      <description>&lt;P&gt;Thanks for the answers guys.  Turns out though what I have above works, once you reload the extracts with &lt;CODE&gt;| extract reload=true&lt;/CODE&gt;.  Added as an answer.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2017 11:40:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-extract-from-a-field-that-was-extracted-in-the-same/m-p/324863#M96893</guid>
      <dc:creator>sillingworth</dc:creator>
      <dc:date>2017-06-02T11:40:10Z</dc:date>
    </item>
    <item>
      <title>Re: Can you extract from a field that was extracted in the same stanza?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-extract-from-a-field-that-was-extracted-in-the-same/m-p/324864#M96894</link>
      <description>&lt;P&gt;Actually scratch that.  The original config started working for me, which I put down to the reload=true, but if I then add a third line extracting a field from within metric_test it still doesn't appear, whereas if I add it based on _raw it does.&lt;/P&gt;

&lt;P&gt;I wonder if something is required to make Splunk aware that it can use metric_test as the source field.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2017 13:13:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-extract-from-a-field-that-was-extracted-in-the-same/m-p/324864#M96894</guid>
      <dc:creator>sillingworth</dc:creator>
      <dc:date>2017-06-02T13:13:05Z</dc:date>
    </item>
    <item>
      <title>Re: Can you extract from a field that was extracted in the same stanza?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-extract-from-a-field-that-was-extracted-in-the-same/m-p/324865#M96895</link>
      <description>&lt;P&gt;What's the reason it has to be done that way?  The docs suggest it's doable in extract.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jun 2017 14:55:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-extract-from-a-field-that-was-extracted-in-the-same/m-p/324865#M96895</guid>
      <dc:creator>sillingworth</dc:creator>
      <dc:date>2017-06-05T14:55:10Z</dc:date>
    </item>
    <item>
      <title>Re: Can you extract from a field that was extracted in the same stanza?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-extract-from-a-field-that-was-extracted-in-the-same/m-p/324866#M96896</link>
      <description>&lt;P&gt;Evert &lt;CODE&gt;EXTRACT&lt;/CODE&gt; happen simultaneously, as does every &lt;CODE&gt;SEDCMD&lt;/CODE&gt; and many other things, but &lt;CODE&gt;REPORT&lt;/CODE&gt; and &lt;CODE&gt;TRANSFORMS&lt;/CODE&gt; can be serialized.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2017 05:16:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-extract-from-a-field-that-was-extracted-in-the-same/m-p/324866#M96896</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-06-06T05:16:20Z</dc:date>
    </item>
  </channel>
</rss>

