<?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: Fields within fields - search time extract in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Fields-within-fields-search-time-extract/m-p/127111#M34457</link>
    <description>&lt;P&gt;I read the linked answer and it points the user towards the doc for transforms.conf. Specifically the SOURCE_KEY value. But, I'm afraid I need more information.  The spec file says it can be used to meet my need but I don't understand how it is entered in the transforms.conf to expose the values to my end users without teaching them rex, etc.&lt;/P&gt;</description>
    <pubDate>Mon, 27 Jan 2014 21:41:24 GMT</pubDate>
    <dc:creator>tyronetv</dc:creator>
    <dc:date>2014-01-27T21:41:24Z</dc:date>
    <item>
      <title>Fields within fields - search time extract</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Fields-within-fields-search-time-extract/m-p/127105#M34451</link>
      <description>&lt;P&gt;Within my event data I have a file name for a data set that we move around between services.  &lt;/P&gt;

&lt;P&gt;Input files are sent in a zip file named "&amp;lt; env &amp;gt;.&amp;lt; app &amp;gt;.&amp;lt; client &amp;gt;&amp;lt; site &amp;gt;.&amp;lt; date &amp;gt;.zip". Where:&lt;/P&gt;

&lt;P&gt;&amp;lt; env &amp;gt; is the environment as "test", "qa", or "prod"&lt;BR /&gt;&lt;BR /&gt;
&amp;lt; app &amp;gt; is the appcode in \w\w\w\d\d\d format&lt;BR /&gt;&lt;BR /&gt;
&amp;lt; client &amp;gt; is the 3-digit client number&lt;BR /&gt;&lt;BR /&gt;
&amp;lt; site &amp;gt; is the 2-digit site code&lt;BR /&gt;&lt;BR /&gt;
&amp;lt; date &amp;gt; is the 3-digit julian date plus "01" for AM, or "02" for PM&lt;/P&gt;

&lt;P&gt;Example:&lt;/P&gt;

&lt;P&gt;test.abc123.51720.02701.zip&lt;/P&gt;

&lt;P&gt;I use the entirety of the file name as my 'source file' (SFIL) to track it through the three systems that touch/move it.&lt;/P&gt;

&lt;P&gt;What I would like to do is ALSO track by &lt;ENV&gt; &lt;APP&gt; &lt;CLIENT&gt; or &lt;SITE&gt; which are parts of the previously define source file (SFIL).&lt;/SITE&gt;&lt;/CLIENT&gt;&lt;/APP&gt;&lt;/ENV&gt;&lt;/P&gt;

&lt;P&gt;Suggestions?&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2014 20:09:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Fields-within-fields-search-time-extract/m-p/127105#M34451</guid>
      <dc:creator>tyronetv</dc:creator>
      <dc:date>2014-01-27T20:09:06Z</dc:date>
    </item>
    <item>
      <title>Re: Fields within fields - search time extract</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Fields-within-fields-search-time-extract/m-p/127106#M34452</link>
      <description>&lt;P&gt;I think you may need to explain more clearly - what are you currently getting stuck on? What do you mean by "track" here?&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2014 20:33:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Fields-within-fields-search-time-extract/m-p/127106#M34452</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2014-01-27T20:33:14Z</dc:date>
    </item>
    <item>
      <title>Re: Fields within fields - search time extract</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Fields-within-fields-search-time-extract/m-p/127107#M34453</link>
      <description>&lt;P&gt;Take a look at this: &lt;A href="http://answers.splunk.com/answers/119984/extracting-fields-from-an-existing-field"&gt;http://answers.splunk.com/answers/119984/extracting-fields-from-an-existing-field&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2014 20:37:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Fields-within-fields-search-time-extract/m-p/127107#M34453</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-01-27T20:37:55Z</dc:date>
    </item>
    <item>
      <title>Re: Fields within fields - search time extract</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Fields-within-fields-search-time-extract/m-p/127108#M34454</link>
      <description>&lt;P&gt;I mean, instead of only doing SFIL=* I would like to do app=* or site=* or client=*.&lt;/P&gt;

&lt;P&gt;For example, client=abc124 site=34 |stats count by hour&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2014 20:39:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Fields-within-fields-search-time-extract/m-p/127108#M34454</guid>
      <dc:creator>tyronetv</dc:creator>
      <dc:date>2014-01-27T20:39:05Z</dc:date>
    </item>
    <item>
      <title>Re: Fields within fields - search time extract</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Fields-within-fields-search-time-extract/m-p/127109#M34455</link>
      <description>&lt;P&gt;Something like:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;source="*.zip" |dedup source |rex field=source "^(P?&amp;lt;env&amp;gt;\w+)\.(P?&amp;lt;app&amp;gt;\w\w\w\d\d\d)\.(P?&amp;lt;client&amp;gt;\d{3})(P?&amp;lt;site&amp;gt;\d{2})" |stats count by env app client site&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;I've not tested this rex extraction, but it should be pretty close, and the concept is sound.&lt;/P&gt;

&lt;P&gt;Once the fields are extracted you can pick and choose which app env client or site to sort on.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2014 20:50:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Fields-within-fields-search-time-extract/m-p/127109#M34455</guid>
      <dc:creator>lukejadamec</dc:creator>
      <dc:date>2014-01-27T20:50:09Z</dc:date>
    </item>
    <item>
      <title>Re: Fields within fields - search time extract</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Fields-within-fields-search-time-extract/m-p/127110#M34456</link>
      <description>&lt;P&gt;This works and I appreciate pointing me to this but I have to figure out how to set it up in transforms.conf so it's visible without teaching the end users to use rex, etc.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2014 21:39:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Fields-within-fields-search-time-extract/m-p/127110#M34456</guid>
      <dc:creator>tyronetv</dc:creator>
      <dc:date>2014-01-27T21:39:01Z</dc:date>
    </item>
    <item>
      <title>Re: Fields within fields - search time extract</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Fields-within-fields-search-time-extract/m-p/127111#M34457</link>
      <description>&lt;P&gt;I read the linked answer and it points the user towards the doc for transforms.conf. Specifically the SOURCE_KEY value. But, I'm afraid I need more information.  The spec file says it can be used to meet my need but I don't understand how it is entered in the transforms.conf to expose the values to my end users without teaching them rex, etc.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2014 21:41:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Fields-within-fields-search-time-extract/m-p/127111#M34457</guid>
      <dc:creator>tyronetv</dc:creator>
      <dc:date>2014-01-27T21:41:24Z</dc:date>
    </item>
    <item>
      <title>Re: Fields within fields - search time extract</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Fields-within-fields-search-time-extract/m-p/127112#M34458</link>
      <description>&lt;P&gt;You did not say you wanted it automatic.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2014 21:43:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Fields-within-fields-search-time-extract/m-p/127112#M34458</guid>
      <dc:creator>lukejadamec</dc:creator>
      <dc:date>2014-01-27T21:43:16Z</dc:date>
    </item>
    <item>
      <title>Re: Fields within fields - search time extract</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Fields-within-fields-search-time-extract/m-p/127113#M34459</link>
      <description>&lt;P&gt;Instead of configuring the config files, you could create a macro that does the extraction.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2014 21:49:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Fields-within-fields-search-time-extract/m-p/127113#M34459</guid>
      <dc:creator>lukejadamec</dc:creator>
      <dc:date>2014-01-27T21:49:53Z</dc:date>
    </item>
    <item>
      <title>Re: Fields within fields - search time extract</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Fields-within-fields-search-time-extract/m-p/127114#M34460</link>
      <description>&lt;P&gt;Exposing the extracted values to the end users without teaching them rex is the point of defining them in props.conf/transforms.conf.&lt;/P&gt;

&lt;P&gt;Define your extraction as any REPORT-classname extraction, but use SOURCE_KEY to tell Splunk to read the source field rather than the default _raw.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2014 21:54:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Fields-within-fields-search-time-extract/m-p/127114#M34460</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-01-27T21:54:02Z</dc:date>
    </item>
    <item>
      <title>Re: Fields within fields - search time extract</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Fields-within-fields-search-time-extract/m-p/127115#M34461</link>
      <description>&lt;P&gt;So, you are saying, in props I could do something similar to:&lt;/P&gt;

&lt;P&gt;EXTRACT-subfields = SOURCE_KEY=SFIL (?&lt;ENV&gt;\w+).(?P&lt;APPCODE&gt;\w{3}\d{3}).(?&lt;DATE&gt;\d{3})(?P&lt;SITECODE&gt;\d{2})&lt;/SITECODE&gt;&lt;/DATE&gt;&lt;/APPCODE&gt;&lt;/ENV&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jan 2014 17:43:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Fields-within-fields-search-time-extract/m-p/127115#M34461</guid>
      <dc:creator>tyronetv</dc:creator>
      <dc:date>2014-01-29T17:43:05Z</dc:date>
    </item>
    <item>
      <title>Re: Fields within fields - search time extract</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Fields-within-fields-search-time-extract/m-p/127116#M34462</link>
      <description>&lt;P&gt;No. Your props.conf would contain something like this under the relevant sourcetype:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;REPORT-subfields = your_subfields
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and transforms.conf would have a matching stanza something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[your_subfields]
SOURCE_KEY = ...
REGEX = ...
FORMAT = ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Take a look at &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Knowledge/Createandmaintainsearch-timefieldextractionsthroughconfigurationfiles#Create_advanced_search-time_field_extractions_with_field_transforms"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Knowledge/Createandmaintainsearch-timefieldextractionsthroughconfigurationfiles#Create_advanced_search-time_field_extractions_with_field_transforms&lt;/A&gt; for reference.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jan 2014 17:52:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Fields-within-fields-search-time-extract/m-p/127116#M34462</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-01-29T17:52:11Z</dc:date>
    </item>
  </channel>
</rss>

