<?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: field extraction based on index in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/field-extraction-based-on-index/m-p/65451#M16253</link>
    <description>&lt;P&gt;Are you sure you are defining the data correctly? If the SourceA data requires different extractions depending on index, then isn't it going to be a different sourcetype? &lt;/P&gt;

&lt;P&gt;If the event data is different, then you could just specify both extractions, and each would only work on the data it matched. IN this case however because the data is different, different sourcetypes should be set.&lt;/P&gt;

&lt;P&gt;If the event data really is the same, then you could do this using eval, to create a field that combines index and raw, and then do the extractions from the new field.&lt;/P&gt;

&lt;P&gt;props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;EVAL-indexplusraw = index . "-" . _raw
EXTRACT-field1 = index1-(&amp;lt;REGEX&amp;gt;) in indexplusraw
EXTRACT-field2 = index2-(&amp;lt;REGEX&amp;gt;) in indexplusraw
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 19 Mar 2013 10:07:17 GMT</pubDate>
    <dc:creator>datasearchninja</dc:creator>
    <dc:date>2013-03-19T10:07:17Z</dc:date>
    <item>
      <title>field extraction based on index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/field-extraction-based-on-index/m-p/65449#M16251</link>
      <description>&lt;P&gt;I have two different indexes, with multiple sources, say source1, source2&lt;/P&gt;

&lt;P&gt;How can I define a different Extraction per Index&lt;/P&gt;

&lt;P&gt;Index1 SourceA Transform1A&lt;BR /&gt;
Index2 SourceA Transform2A&lt;/P&gt;

&lt;P&gt;I could only specify the source by extractions.... &lt;/P&gt;</description>
      <pubDate>Tue, 19 Mar 2013 07:17:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/field-extraction-based-on-index/m-p/65449#M16251</guid>
      <dc:creator>sbsbb</dc:creator>
      <dc:date>2013-03-19T07:17:30Z</dc:date>
    </item>
    <item>
      <title>Re: field extraction based on index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/field-extraction-based-on-index/m-p/65450#M16252</link>
      <description>&lt;P&gt;I believe you cannot specify extractions based on index. You're talking about index and source - what about sourcetype?&lt;/P&gt;</description>
      <pubDate>Tue, 19 Mar 2013 08:35:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/field-extraction-based-on-index/m-p/65450#M16252</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2013-03-19T08:35:19Z</dc:date>
    </item>
    <item>
      <title>Re: field extraction based on index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/field-extraction-based-on-index/m-p/65451#M16253</link>
      <description>&lt;P&gt;Are you sure you are defining the data correctly? If the SourceA data requires different extractions depending on index, then isn't it going to be a different sourcetype? &lt;/P&gt;

&lt;P&gt;If the event data is different, then you could just specify both extractions, and each would only work on the data it matched. IN this case however because the data is different, different sourcetypes should be set.&lt;/P&gt;

&lt;P&gt;If the event data really is the same, then you could do this using eval, to create a field that combines index and raw, and then do the extractions from the new field.&lt;/P&gt;

&lt;P&gt;props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;EVAL-indexplusraw = index . "-" . _raw
EXTRACT-field1 = index1-(&amp;lt;REGEX&amp;gt;) in indexplusraw
EXTRACT-field2 = index2-(&amp;lt;REGEX&amp;gt;) in indexplusraw
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 19 Mar 2013 10:07:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/field-extraction-based-on-index/m-p/65451#M16253</guid>
      <dc:creator>datasearchninja</dc:creator>
      <dc:date>2013-03-19T10:07:17Z</dc:date>
    </item>
  </channel>
</rss>

