<?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: In what phase are discovered fields available (automatic field extraction)? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/In-what-phase-are-discovered-fields-available-automatic-field/m-p/263217#M176404</link>
    <description>&lt;P&gt;Splunk will also auto discover fields that are mentioned in the search and it doesn't matter in which search mode you are, but that shouldn't be the problem because this 'ses' field will be used in the search (ses=1234567890). It will be a key-part of the search I ultimately trying to use.&lt;/P&gt;

&lt;P&gt;Some documentation about this (see the link I mentioned in the question and in you last comment &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.5.0/Knowledge/WhenSplunkEnterpriseaddsfields):"&gt;http://docs.splunk.com/Documentation/Splunk/6.5.0/Knowledge/WhenSplunkEnterpriseaddsfields):&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;When field discovery is enabled, Splunk software:&lt;BR /&gt;
- &lt;STRONG&gt;Identifies and extracts&lt;/STRONG&gt; the first 50 fields that it finds in the event data &lt;STRONG&gt;that match obvious key=value pairs&lt;/STRONG&gt;. This 50 field limit is a default that you can modify by editing the [kv] stanza in limits.conf, if you have Splunk Enterprise.&lt;BR /&gt;
- Extracts any field &lt;STRONG&gt;explicitly mentioned in the search&lt;/STRONG&gt; that it might otherwise have found though automatic extraction, but is not among the first 50 fields identified.&lt;BR /&gt;
- &lt;STRONG&gt;Performs custom field extractions&lt;/STRONG&gt; that you have defined, either through the Field Extractor, the Extracted Fields page in Settings, configuration file edits, or search commands such as rex. &lt;/P&gt;

&lt;P&gt;Is Splunk following this order as mentioned (top-down)?&lt;BR /&gt;
- Yes? Then I expect my example in the question to work&lt;BR /&gt;
- No? What order is followed?&lt;/P&gt;</description>
    <pubDate>Fri, 21 Oct 2016 13:03:30 GMT</pubDate>
    <dc:creator>vxsplunk</dc:creator>
    <dc:date>2016-10-21T13:03:30Z</dc:date>
    <item>
      <title>In what phase are discovered fields available (automatic field extraction)?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/In-what-phase-are-discovered-fields-available-automatic-field/m-p/263213#M176400</link>
      <description>&lt;P&gt;I want to add a field to my events that is derived from a discovered field at search time. The new field wil be a primary field used in searches, therefore I can't use "| eval new=substr(..)".&lt;/P&gt;

&lt;P&gt;Example logging:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2016-10-18 11:22:33.456 ERROR session=12akeife0wkefs0e835i5l0iwef 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;When searched for '&lt;STRONG&gt;ERROR&lt;/STRONG&gt;', the field '&lt;STRONG&gt;session&lt;/STRONG&gt;' is automatically discovered. That's good.&lt;/P&gt;

&lt;P&gt;Now I want to create a new field '&lt;STRONG&gt;ses&lt;/STRONG&gt;' and fill it with the first 10 characters of '&lt;STRONG&gt;session&lt;/STRONG&gt;'. This is how I think this should be done:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;transforms.conf:    
[ses]
REGEX=(.{10})
FORMAT=ses::$1
SOURCE_KEY=session

props.conf:
[sourcetype_x]
REPORT-ses = ses
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now when I search for '&lt;STRONG&gt;ERROR&lt;/STRONG&gt;', I would expect to find the new field '&lt;STRONG&gt;ses&lt;/STRONG&gt;' with value '&lt;STRONG&gt;12akeife0w&lt;/STRONG&gt;', but it isn't there.&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;I took notice of:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.5.0/Admin/Configurationparametersandthedatapipeline#How_configuration_parameters_correlate_to_phases_of_the_pipeline" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/6.5.0/Admin/Configurationparametersandthedatapipeline#How_configuration_parameters_correlate_to_phases_of_the_pipeline&lt;/A&gt;&lt;BR /&gt;
How configuration parameters correlate to phases of the pipeline - Search phase&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.5.0/admin/propsconf" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/6.5.0/admin/propsconf&lt;/A&gt;&lt;BR /&gt;
&lt;EM&gt;Search-time field extractions: Why use REPORT if EXTRACT will do?&lt;BR /&gt;
It's a good question. And much of the time, EXTRACT is all you need for&lt;BR /&gt;
search-time field extraction. But when you build search-time field&lt;BR /&gt;
extractions, there are specific cases that require the use of REPORT and the&lt;BR /&gt;
field transform that it references. Use REPORT if you want to:&lt;BR /&gt;
...&lt;BR /&gt;
* Manage formatting of extracted fields, in cases where you are extracting&lt;BR /&gt;
  multiple fields, or are extracting both the field name and field value.&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.5.0/Knowledge/WhenSplunkEnterpriseaddsfields" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/6.5.0/Knowledge/WhenSplunkEnterpriseaddsfields&lt;/A&gt;&lt;BR /&gt;
&lt;EM&gt;When field discovery is enabled, Splunk software:&lt;BR /&gt;
• **Identifies and extracts the first 50 fields that it finds in the event data that match obvious key=value pairs&lt;/EM&gt;&lt;EM&gt;. This 50 field limit is a default that you can modify by editing the [kv] stanza in limits.conf, if you have Splunk Enterprise.&lt;BR /&gt;
• Extracts any field explicitly mentioned in the search that it might otherwise have found though automatic extraction, but is not among the first 50 fields identified.&lt;BR /&gt;
• **Performs custom field extractions that you have defined&lt;/EM&gt;&lt;EM&gt;, either through the Field Extractor, the Extracted Fields page in Settings, configuration file edits, or search commands such as rex.&lt;/EM&gt;&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;&lt;STRONG&gt;My question(s):&lt;/STRONG&gt; &lt;BR /&gt;
In what phase are discovered fields available?&lt;BR /&gt;
Are discovered fields available before a transform at search-time?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:29:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/In-what-phase-are-discovered-fields-available-automatic-field/m-p/263213#M176400</guid>
      <dc:creator>vxsplunk</dc:creator>
      <dc:date>2020-09-29T11:29:03Z</dc:date>
    </item>
    <item>
      <title>Re: In what phase are discovered fields available (automatic field extraction)?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/In-what-phase-are-discovered-fields-available-automatic-field/m-p/263214#M176401</link>
      <description>&lt;P&gt;Try this for your transforms. Removed &lt;CODE&gt;SOURCE_KEY&lt;/CODE&gt; The source for your extraction is _raw (default). and modified your regex.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;transforms.conf:    
 [ses]
 REGEX=session=(\w{10})
 FORMAT=ses::$1
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 18 Oct 2016 13:08:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/In-what-phase-are-discovered-fields-available-automatic-field/m-p/263214#M176401</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-10-18T13:08:34Z</dc:date>
    </item>
    <item>
      <title>Re: In what phase are discovered fields available (automatic field extraction)?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/In-what-phase-are-discovered-fields-available-automatic-field/m-p/263215#M176402</link>
      <description>&lt;P&gt;I knew this workaround and it works, but that is not what I was trying to accomplish or to find out. Because of SOURCE_KEY=&lt;STRONG&gt;_raw&lt;/STRONG&gt; I have to manually extract fields again that are also auto discovered/extracted and this gives me much more to configure.&lt;/P&gt;

&lt;P&gt;To better understand field discovery I would like to know in what phase (see my intro to the question) field discovery is done?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:29:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/In-what-phase-are-discovered-fields-available-automatic-field/m-p/263215#M176402</guid>
      <dc:creator>vxsplunk</dc:creator>
      <dc:date>2020-09-29T11:29:58Z</dc:date>
    </item>
    <item>
      <title>Re: In what phase are discovered fields available (automatic field extraction)?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/In-what-phase-are-discovered-fields-available-automatic-field/m-p/263216#M176403</link>
      <description>&lt;P&gt;See if this answers your question. Field discovery is done in  the search phase. Field discovery depends on your search mode. If you search in Fast Mode, Splunk does not auto discover fields. In Smart mode, only if you don't use any transforming commands. However, it will always auto-discover fields in the Verbose mode. &lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.5.0/Knowledge/WhenSplunkEnterpriseaddsfields"&gt;http://docs.splunk.com/Documentation/Splunk/6.5.0/Knowledge/WhenSplunkEnterpriseaddsfields&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2016 10:50:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/In-what-phase-are-discovered-fields-available-automatic-field/m-p/263216#M176403</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-10-19T10:50:19Z</dc:date>
    </item>
    <item>
      <title>Re: In what phase are discovered fields available (automatic field extraction)?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/In-what-phase-are-discovered-fields-available-automatic-field/m-p/263217#M176404</link>
      <description>&lt;P&gt;Splunk will also auto discover fields that are mentioned in the search and it doesn't matter in which search mode you are, but that shouldn't be the problem because this 'ses' field will be used in the search (ses=1234567890). It will be a key-part of the search I ultimately trying to use.&lt;/P&gt;

&lt;P&gt;Some documentation about this (see the link I mentioned in the question and in you last comment &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.5.0/Knowledge/WhenSplunkEnterpriseaddsfields):"&gt;http://docs.splunk.com/Documentation/Splunk/6.5.0/Knowledge/WhenSplunkEnterpriseaddsfields):&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;When field discovery is enabled, Splunk software:&lt;BR /&gt;
- &lt;STRONG&gt;Identifies and extracts&lt;/STRONG&gt; the first 50 fields that it finds in the event data &lt;STRONG&gt;that match obvious key=value pairs&lt;/STRONG&gt;. This 50 field limit is a default that you can modify by editing the [kv] stanza in limits.conf, if you have Splunk Enterprise.&lt;BR /&gt;
- Extracts any field &lt;STRONG&gt;explicitly mentioned in the search&lt;/STRONG&gt; that it might otherwise have found though automatic extraction, but is not among the first 50 fields identified.&lt;BR /&gt;
- &lt;STRONG&gt;Performs custom field extractions&lt;/STRONG&gt; that you have defined, either through the Field Extractor, the Extracted Fields page in Settings, configuration file edits, or search commands such as rex. &lt;/P&gt;

&lt;P&gt;Is Splunk following this order as mentioned (top-down)?&lt;BR /&gt;
- Yes? Then I expect my example in the question to work&lt;BR /&gt;
- No? What order is followed?&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2016 13:03:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/In-what-phase-are-discovered-fields-available-automatic-field/m-p/263217#M176404</guid>
      <dc:creator>vxsplunk</dc:creator>
      <dc:date>2016-10-21T13:03:30Z</dc:date>
    </item>
  </channel>
</rss>

