<?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: Why does a transforms report stanza have issues with source key? in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Why-does-a-transforms-report-stanza-have-issues-with-source-key/m-p/345926#M5427</link>
    <description>&lt;P&gt;Yes, In order to use for the field to be SOURCE_KEY in the REPORT/transforms - you either get that through EXTRACT OR REPORT and make sure the stanza that is extracting the SOURCE_KEY evaluates before the stanza where you want to use it&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 15:11:52 GMT</pubDate>
    <dc:creator>bheemireddi</dc:creator>
    <dc:date>2020-09-29T15:11:52Z</dc:date>
    <item>
      <title>Why does a transforms report stanza have issues with source key?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Why-does-a-transforms-report-stanza-have-issues-with-source-key/m-p/345918#M5419</link>
      <description>&lt;P&gt;Specifically, I have a search-time transform which works against _raw but not against a source key.  When it only specifies a regex and a source key, it does not work, but when the source key is removed, it does work.  It would be really good to also gain a general understanding of what contributes to source key not working.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype: splunkd
regex: \/+handshake\/+reply\/+(?&amp;lt;deploy_client_name&amp;gt;[^\/]+)\/+(?&amp;lt;deploy_client&amp;gt;\S+)
source key: _raw OR channel; the first works and the second does not.
&lt;A href="https://regex101.com/r/eI7V1B/2" target="test_blank"&gt;https://regex101.com/r/eI7V1B/2&lt;/A&gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The field channel extracts normally by default but does not seem to be available for the transform.  Is it possible to get the transfer to work against the field, channel?&lt;/P&gt;

&lt;P&gt;In any Splunk environment, you should see that channel is extracted by default with the following search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal sourcetype=splunkd component=PubSubSvr reply handshake PubSubSvr | dedup channel | table channel deploy*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can use my regex (above) in a transform on your own search head to duplicate the issue that I am describing.  Here is the transform:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[ds_msg_client_handshake]
CLEAN_KEYS = 0
REGEX = \/handshake\/reply\/(?P&amp;lt;deploy_client_name&amp;gt;[^\/]+)\/(?P&amp;lt;deploy_client&amp;gt;\S+)
SOURCE_KEY = channel
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 02 Aug 2017 16:14:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Why-does-a-transforms-report-stanza-have-issues-with-source-key/m-p/345918#M5419</guid>
      <dc:creator>landen99</dc:creator>
      <dc:date>2017-08-02T16:14:25Z</dc:date>
    </item>
    <item>
      <title>Re: Why does a transforms report stanza have issues with source key?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Why-does-a-transforms-report-stanza-have-issues-with-source-key/m-p/345919#M5420</link>
      <description>&lt;P&gt;This transform is doing index-time activity or search time? &lt;/P&gt;</description>
      <pubDate>Wed, 02 Aug 2017 16:22:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Why-does-a-transforms-report-stanza-have-issues-with-source-key/m-p/345919#M5420</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-08-02T16:22:30Z</dc:date>
    </item>
    <item>
      <title>Re: Why does a transforms report stanza have issues with source key?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Why-does-a-transforms-report-stanza-have-issues-with-source-key/m-p/345920#M5421</link>
      <description>&lt;P&gt;how is the channel field getting extracted? using another transforms?KV_MODE?  did notice something before it doesn't do much if it is from the KV_MODE.&lt;/P&gt;

&lt;P&gt;Can you paste sample transforms where you are using SOURCE_KEY? and also how the channel field getting extracted in this case?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:11:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Why-does-a-transforms-report-stanza-have-issues-with-source-key/m-p/345920#M5421</guid>
      <dc:creator>bheemireddi</dc:creator>
      <dc:date>2020-09-29T15:11:38Z</dc:date>
    </item>
    <item>
      <title>Re: Why does a transforms report stanza have issues with source key?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Why-does-a-transforms-report-stanza-have-issues-with-source-key/m-p/345921#M5422</link>
      <description>&lt;P&gt;search time&lt;/P&gt;</description>
      <pubDate>Wed, 02 Aug 2017 17:20:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Why-does-a-transforms-report-stanza-have-issues-with-source-key/m-p/345921#M5422</guid>
      <dc:creator>landen99</dc:creator>
      <dc:date>2017-08-02T17:20:05Z</dc:date>
    </item>
    <item>
      <title>Re: Why does a transforms report stanza have issues with source key?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Why-does-a-transforms-report-stanza-have-issues-with-source-key/m-p/345922#M5423</link>
      <description>&lt;P&gt;The channel field is extracted by default against the splunkd sourcetype.  I didn't do anything to extract "channel".  You can see the events in your own deployments by searching:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal sourcetype=splunkd component=PubSubSvr reply handshake PubSubSvr | dedup channel | table channel deploy*
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 02 Aug 2017 17:22:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Why-does-a-transforms-report-stanza-have-issues-with-source-key/m-p/345922#M5423</guid>
      <dc:creator>landen99</dc:creator>
      <dc:date>2017-08-02T17:22:57Z</dc:date>
    </item>
    <item>
      <title>Re: Why does a transforms report stanza have issues with source key?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Why-does-a-transforms-report-stanza-have-issues-with-source-key/m-p/345923#M5424</link>
      <description>&lt;P&gt;Here is the transform stanza:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[ds_msg_client_handshake]
CLEAN_KEYS = 0
REGEX = \/handshake\/reply\/(?P&amp;lt;deploy_client_name&amp;gt;[^\/]+)\/(?P&amp;lt;deploy_client&amp;gt;\S+)
SOURCE_KEY = channel
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 02 Aug 2017 17:30:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Why-does-a-transforms-report-stanza-have-issues-with-source-key/m-p/345923#M5424</guid>
      <dc:creator>landen99</dc:creator>
      <dc:date>2017-08-02T17:30:44Z</dc:date>
    </item>
    <item>
      <title>Re: Why does a transforms report stanza have issues with source key?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Why-does-a-transforms-report-stanza-have-issues-with-source-key/m-p/345924#M5425</link>
      <description>&lt;P&gt;Yes, all the field extractions for the splunkd source type are through KV_MODE, since this is auto by default. So I am not surprised it did not work as the SOURCE_KEY, as the field extractions also have the precedence of their operations.&lt;/P&gt;

&lt;P&gt;REPORT goes first before KV_MODE, and  the channel field won't be available for your REPORT in the transforms.conf&lt;/P&gt;

&lt;P&gt;For more understanding on the precedence, probably below thread might help&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/475935/for-a-field-user-which-has-precedence-an-eval-defi.html" target="_blank"&gt;https://answers.splunk.com/answers/475935/for-a-field-user-which-has-precedence-an-eval-defi.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:11:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Why-does-a-transforms-report-stanza-have-issues-with-source-key/m-p/345924#M5425</guid>
      <dc:creator>bheemireddi</dc:creator>
      <dc:date>2020-09-29T15:11:44Z</dc:date>
    </item>
    <item>
      <title>Re: Why does a transforms report stanza have issues with source key?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Why-does-a-transforms-report-stanza-have-issues-with-source-key/m-p/345925#M5426</link>
      <description>&lt;P&gt;So is the solution then to configure a props to extract the field first so that it is available before the transform's report call?  Or is there a better solution?&lt;/P&gt;</description>
      <pubDate>Wed, 02 Aug 2017 18:42:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Why-does-a-transforms-report-stanza-have-issues-with-source-key/m-p/345925#M5426</guid>
      <dc:creator>landen99</dc:creator>
      <dc:date>2017-08-02T18:42:39Z</dc:date>
    </item>
    <item>
      <title>Re: Why does a transforms report stanza have issues with source key?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Why-does-a-transforms-report-stanza-have-issues-with-source-key/m-p/345926#M5427</link>
      <description>&lt;P&gt;Yes, In order to use for the field to be SOURCE_KEY in the REPORT/transforms - you either get that through EXTRACT OR REPORT and make sure the stanza that is extracting the SOURCE_KEY evaluates before the stanza where you want to use it&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:11:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Why-does-a-transforms-report-stanza-have-issues-with-source-key/m-p/345926#M5427</guid>
      <dc:creator>bheemireddi</dc:creator>
      <dc:date>2020-09-29T15:11:52Z</dc:date>
    </item>
    <item>
      <title>Re: Why does a transforms report stanza have issues with source key?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Why-does-a-transforms-report-stanza-have-issues-with-source-key/m-p/345927#M5428</link>
      <description>&lt;P&gt;I think that you meant to make this a reply to my comment on your answer above...&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2017 14:04:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Why-does-a-transforms-report-stanza-have-issues-with-source-key/m-p/345927#M5428</guid>
      <dc:creator>landen99</dc:creator>
      <dc:date>2017-08-03T14:04:02Z</dc:date>
    </item>
  </channel>
</rss>

