<?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: Index selection conditional on values in the data in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Index-selection-conditional-on-values-in-the-data/m-p/232419#M45323</link>
    <description>&lt;P&gt;Okay, this is close but not quite working.  I've got something like this in transforms.conf:&lt;/P&gt;

&lt;P&gt;[special-data]&lt;BR /&gt;
DEST_KEY = _MetaData:Index&lt;BR /&gt;
REGEX = b=[3|30|44|49|21]&lt;BR /&gt;
FORMAT = special-index&lt;/P&gt;

&lt;P&gt;[normal-data]&lt;BR /&gt;
DEST_KEY=_MetaData:Index&lt;BR /&gt;
FORMAT = normal-index&lt;/P&gt;

&lt;P&gt;And then, in props.conf, I have something like this:&lt;/P&gt;

&lt;P&gt;[mysourcetype]&lt;BR /&gt;
TRANSFORMS-indexsort = special-data, normal-data&lt;/P&gt;

&lt;P&gt;There must be something unhappy with the REGEX, because everything ends up in special-index.  Hmm.&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 07:19:27 GMT</pubDate>
    <dc:creator>davidatpinger</dc:creator>
    <dc:date>2020-09-29T07:19:27Z</dc:date>
    <item>
      <title>Index selection conditional on values in the data</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Index-selection-conditional-on-values-in-the-data/m-p/232416#M45320</link>
      <description>&lt;P&gt;I've got a bunch of key-value data, something sorta like this:&lt;/P&gt;

&lt;P&gt;a=1,b=2,c=3,d=4&lt;BR /&gt;
a=5,b=6,c=7,d=8&lt;BR /&gt;
a=9,b=2,c=10,d=11&lt;BR /&gt;
(etc.)&lt;/P&gt;

&lt;P&gt;I'd like to sort this data into different indexes (for the purpose of different retention times) depending on the value passed to the 'b' key.  So, if b=2, send the data to index_retain_for_one_week but if b=6, send the data to index_retain_for_one_month.  Ideally, there would be a final condition for values of 'b' that aren't listed.  Think of this as an 'else' condition that sends non-matching data for the list of conditions to index_retain_one_day.  (All of the index names are just illustrative, like the data.)&lt;/P&gt;

&lt;P&gt;Is there a good way to do that?  Heck, is it possible?  My apologies if this is already answered somewhere - I couldn't find a set of key words that generated an answer.  Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 07:19:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Index-selection-conditional-on-values-in-the-data/m-p/232416#M45320</guid>
      <dc:creator>davidatpinger</dc:creator>
      <dc:date>2020-09-29T07:19:19Z</dc:date>
    </item>
    <item>
      <title>Re: Index selection conditional on values in the data</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Index-selection-conditional-on-values-in-the-data/m-p/232417#M45321</link>
      <description>&lt;P&gt;Here you go&lt;/P&gt;

&lt;P&gt;&lt;A href="http://answers.splunk.com/answers/150266/dynamic-index-assignment-based-on-event-or-log-prefix.html"&gt;http://answers.splunk.com/answers/150266/dynamic-index-assignment-based-on-event-or-log-prefix.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Sep 2015 21:25:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Index-selection-conditional-on-values-in-the-data/m-p/232417#M45321</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-09-21T21:25:41Z</dc:date>
    </item>
    <item>
      <title>Re: Index selection conditional on values in the data</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Index-selection-conditional-on-values-in-the-data/m-p/232418#M45322</link>
      <description>&lt;P&gt;I suppose I can make multiple stanzas of transforms and they are applied in order by the TRANSFORMS statement in props.conf.  So yeah, this will work!  Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 21 Sep 2015 22:13:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Index-selection-conditional-on-values-in-the-data/m-p/232418#M45322</guid>
      <dc:creator>davidatpinger</dc:creator>
      <dc:date>2015-09-21T22:13:12Z</dc:date>
    </item>
    <item>
      <title>Re: Index selection conditional on values in the data</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Index-selection-conditional-on-values-in-the-data/m-p/232419#M45323</link>
      <description>&lt;P&gt;Okay, this is close but not quite working.  I've got something like this in transforms.conf:&lt;/P&gt;

&lt;P&gt;[special-data]&lt;BR /&gt;
DEST_KEY = _MetaData:Index&lt;BR /&gt;
REGEX = b=[3|30|44|49|21]&lt;BR /&gt;
FORMAT = special-index&lt;/P&gt;

&lt;P&gt;[normal-data]&lt;BR /&gt;
DEST_KEY=_MetaData:Index&lt;BR /&gt;
FORMAT = normal-index&lt;/P&gt;

&lt;P&gt;And then, in props.conf, I have something like this:&lt;/P&gt;

&lt;P&gt;[mysourcetype]&lt;BR /&gt;
TRANSFORMS-indexsort = special-data, normal-data&lt;/P&gt;

&lt;P&gt;There must be something unhappy with the REGEX, because everything ends up in special-index.  Hmm.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 07:19:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Index-selection-conditional-on-values-in-the-data/m-p/232419#M45323</guid>
      <dc:creator>davidatpinger</dc:creator>
      <dc:date>2020-09-29T07:19:27Z</dc:date>
    </item>
    <item>
      <title>Re: Index selection conditional on values in the data</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Index-selection-conditional-on-values-in-the-data/m-p/232420#M45324</link>
      <description>&lt;P&gt;You forgot to add "REGEX = ." in the normal-data stanza.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[special-data]
DEST_KEY = _MetaData:Index
REGEX = b=[3|30|44|49|21]
FORMAT = special-index

[normal-data]
REGEX = .
DEST_KEY=_MetaData:Index
FORMAT = normal-index
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 22 Sep 2015 18:36:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Index-selection-conditional-on-values-in-the-data/m-p/232420#M45324</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-09-22T18:36:42Z</dc:date>
    </item>
    <item>
      <title>Re: Index selection conditional on values in the data</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Index-selection-conditional-on-values-in-the-data/m-p/232421#M45325</link>
      <description>&lt;P&gt;Yeah, and I need parens instead of square brackets.  Getting there!  (Thanks!!)&lt;/P&gt;</description>
      <pubDate>Tue, 22 Sep 2015 18:46:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Index-selection-conditional-on-values-in-the-data/m-p/232421#M45325</guid>
      <dc:creator>davidatpinger</dc:creator>
      <dc:date>2015-09-22T18:46:42Z</dc:date>
    </item>
    <item>
      <title>Re: Index selection conditional on values in the data</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Index-selection-conditional-on-values-in-the-data/m-p/232422#M45326</link>
      <description>&lt;P&gt;Hmm, now everything is falling through to normal-data.  Time to muck around with it some more.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Sep 2015 19:52:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Index-selection-conditional-on-values-in-the-data/m-p/232422#M45326</guid>
      <dc:creator>davidatpinger</dc:creator>
      <dc:date>2015-09-22T19:52:01Z</dc:date>
    </item>
    <item>
      <title>Re: Index selection conditional on values in the data</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Index-selection-conditional-on-values-in-the-data/m-p/232423#M45327</link>
      <description>&lt;P&gt;Check the REGEX for special-data, may be some spaces that need to be adjusted etc. If you can send some actual sample data, I can try to look at it as well..&lt;/P&gt;</description>
      <pubDate>Tue, 22 Sep 2015 20:18:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Index-selection-conditional-on-values-in-the-data/m-p/232423#M45327</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-09-22T20:18:10Z</dc:date>
    </item>
    <item>
      <title>Re: Index selection conditional on values in the data</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Index-selection-conditional-on-values-in-the-data/m-p/232424#M45328</link>
      <description>&lt;P&gt;Also, can you do this, in your porps.conf and transforms.conf, change the order of the stanza, so get the normal-data first and special-data after that.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Sep 2015 20:22:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Index-selection-conditional-on-values-in-the-data/m-p/232424#M45328</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-09-22T20:22:40Z</dc:date>
    </item>
    <item>
      <title>Re: Index selection conditional on values in the data</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Index-selection-conditional-on-values-in-the-data/m-p/232425#M45329</link>
      <description>&lt;P&gt;I discovered that my brain was backwards.  It's not first-match and stop in the listed transforms in props.conf - it runs to the end and the last match is what you get.  &lt;/P&gt;

&lt;P&gt;Once I got that through my skull, everything works as expected.  Thanks much!&lt;/P&gt;</description>
      <pubDate>Fri, 02 Oct 2015 21:40:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Index-selection-conditional-on-values-in-the-data/m-p/232425#M45329</guid>
      <dc:creator>davidatpinger</dc:creator>
      <dc:date>2015-10-02T21:40:22Z</dc:date>
    </item>
  </channel>
</rss>

