<?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: Routing events to a specific index based on a field value via transforms and props not working as expected in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Routing-events-to-a-specific-index-based-on-a-field-value-via/m-p/506798#M86259</link>
    <description>&lt;P&gt;Could you do it using props and transforms?&lt;/P&gt;</description>
    <pubDate>Tue, 30 Jun 2020 23:21:13 GMT</pubDate>
    <dc:creator>rmanrique</dc:creator>
    <dc:date>2020-06-30T23:21:13Z</dc:date>
    <item>
      <title>Routing events to a specific index based on a field value via transforms and props not working as expected</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Routing-events-to-a-specific-index-based-on-a-field-value-via/m-p/192150#M38300</link>
      <description>&lt;P&gt;I am trying to route certain events to a specific index based on a field value.  All events are sent to a heavy forwarder, which then forwards traffic to my indexers.  The system that generates the events I want to reroute required a custom data input, so on the heavy forwarder I have a data input defined on a specific UDP port.  The data input places all events from this system into a specific index, &lt;CODE&gt;indexA&lt;/CODE&gt; for simplicity.  Some events from this system contain a certain field value, we'll call it &lt;CODE&gt;reRouteMe&lt;/CODE&gt;, in a certain field, &lt;CODE&gt;fieldA&lt;/CODE&gt;.  For these events, I want to move them to a different index, &lt;CODE&gt;indexB&lt;/CODE&gt;.    &lt;/P&gt;

&lt;P&gt;So basically, for all events from this specific source - if &lt;CODE&gt;fieldA = reRouteMe&lt;/CODE&gt; I want this to go to &lt;CODE&gt;indexB&lt;/CODE&gt;, otherwise, the event should go to its normal index &lt;CODE&gt;indexA&lt;/CODE&gt; defined in the data input.  This is the current configuration on the HFWD, which is not working for some reason:&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[sourcetypeA]
TRANSFORMS-reroute = reRouteMe
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[reRouteMe]
SOURCE_KEY  = _raw
REGEX = (reRouteMe)
DEST_KEY = _MetaData:Index
FORMAT = indexB
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I've also tried applying this on my indexers to no avail, and I've tried REGEX variances such as &lt;CODE&gt;fieldA=reRouteMe&lt;/CODE&gt;, etc.  I'm leaning toward the issue being the custom data input that's defined on the forwarder inferring with the props / transforms, but I would think the props / transforms on the indexers would catch it.  &lt;/P&gt;

&lt;P&gt;Thoughts?&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Aug 2015 17:02:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Routing-events-to-a-specific-index-based-on-a-field-value-via/m-p/192150#M38300</guid>
      <dc:creator>IngloriousSplun</dc:creator>
      <dc:date>2015-08-24T17:02:08Z</dc:date>
    </item>
    <item>
      <title>Re: Routing events to a specific index based on a field value via transforms and props not working as expected</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Routing-events-to-a-specific-index-based-on-a-field-value-via/m-p/192151#M38301</link>
      <description>&lt;P&gt;If I were you, I would just do it after the fact and copy the special events into a summary index using the &lt;CODE&gt;collect&lt;/CODE&gt; command; this will be FAR easier (it moves from exceedingly difficult, perhaps even impossible, to absolutely trivial):&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.5/SearchReference/collect"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.5/SearchReference/collect&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Aug 2015 20:38:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Routing-events-to-a-specific-index-based-on-a-field-value-via/m-p/192151#M38301</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-08-24T20:38:51Z</dc:date>
    </item>
    <item>
      <title>Re: Routing events to a specific index based on a field value via transforms and props not working as expected</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Routing-events-to-a-specific-index-based-on-a-field-value-via/m-p/192152#M38302</link>
      <description>&lt;P&gt;We receive hundreds of events a day that have to be moved to this other index in a streaming fashion.  If it was just a one-off case I'd agree this is a good solution.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Aug 2015 14:17:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Routing-events-to-a-specific-index-based-on-a-field-value-via/m-p/192152#M38302</guid>
      <dc:creator>IngloriousSplun</dc:creator>
      <dc:date>2015-08-25T14:17:27Z</dc:date>
    </item>
    <item>
      <title>Re: Routing events to a specific index based on a field value via transforms and props not working as expected</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Routing-events-to-a-specific-index-based-on-a-field-value-via/m-p/192153#M38303</link>
      <description>&lt;P&gt;Hundreds/day is nothing.  I would still use the &lt;CODE&gt;collect&lt;/CODE&gt; command run every hour.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Aug 2015 14:20:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Routing-events-to-a-specific-index-based-on-a-field-value-via/m-p/192153#M38303</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-08-25T14:20:45Z</dc:date>
    </item>
    <item>
      <title>Re: Routing events to a specific index based on a field value via transforms and props not working as expected</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Routing-events-to-a-specific-index-based-on-a-field-value-via/m-p/192154#M38304</link>
      <description>&lt;P&gt;So running &lt;CODE&gt;[field]=[value] | collect index=[new]&lt;/CODE&gt; did not result in the events moving?  They are still in the original index.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Aug 2015 14:44:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Routing-events-to-a-specific-index-based-on-a-field-value-via/m-p/192154#M38304</guid>
      <dc:creator>IngloriousSplun</dc:creator>
      <dc:date>2015-08-25T14:44:38Z</dc:date>
    </item>
    <item>
      <title>Re: Routing events to a specific index based on a field value via transforms and props not working as expected</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Routing-events-to-a-specific-index-based-on-a-field-value-via/m-p/192155#M38305</link>
      <description>&lt;P&gt;Actually, I missed that &lt;CODE&gt;collect&lt;/CODE&gt; moves to a summary index.  We aren't permitted to have these events in this index, so I need to move these events to the new index and ensure they aren't in the original.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Aug 2015 14:48:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Routing-events-to-a-specific-index-based-on-a-field-value-via/m-p/192155#M38305</guid>
      <dc:creator>IngloriousSplun</dc:creator>
      <dc:date>2015-08-25T14:48:28Z</dc:date>
    </item>
    <item>
      <title>Re: Routing events to a specific index based on a field value via transforms and props not working as expected</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Routing-events-to-a-specific-index-based-on-a-field-value-via/m-p/192156#M38306</link>
      <description>&lt;P&gt;The &lt;CODE&gt;collect&lt;/CODE&gt; command copies them, you still need to use &lt;CODE&gt;delete&lt;/CODE&gt; to remove (hide) them from the original index.  As far as going to a &lt;CODE&gt;summary index&lt;/CODE&gt;, that only means that you you will not be charged twice for the volume against your license, which is a very good thing.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Aug 2015 15:01:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Routing-events-to-a-specific-index-based-on-a-field-value-via/m-p/192156#M38306</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-08-25T15:01:32Z</dc:date>
    </item>
    <item>
      <title>Re: Routing events to a specific index based on a field value via transforms and props not working as expected</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Routing-events-to-a-specific-index-based-on-a-field-value-via/m-p/192157#M38307</link>
      <description>&lt;P&gt;I also missed that it doesn't keep the sourcetype, so they are all in the new index with a &lt;CODE&gt;host&lt;/CODE&gt; field as the search head and the &lt;CODE&gt;sourcetype&lt;/CODE&gt; of &lt;CODE&gt;stash&lt;/CODE&gt;.  So I should be able to do &lt;CODE&gt;[field]=[value] | collect index=[new] sourcetype=[sourcetype] host=[host[&lt;/CODE&gt; to maintain the metadata correct?&lt;/P&gt;</description>
      <pubDate>Tue, 25 Aug 2015 15:03:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Routing-events-to-a-specific-index-based-on-a-field-value-via/m-p/192157#M38307</guid>
      <dc:creator>IngloriousSplun</dc:creator>
      <dc:date>2015-08-25T15:03:58Z</dc:date>
    </item>
    <item>
      <title>Re: Routing events to a specific index based on a field value via transforms and props not working as expected</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Routing-events-to-a-specific-index-based-on-a-field-value-via/m-p/192158#M38308</link>
      <description>&lt;P&gt;This resolved my issue well enough for now until I can figure out why the routing stopped working.  Thanks for the help!&lt;/P&gt;</description>
      <pubDate>Tue, 25 Aug 2015 15:14:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Routing-events-to-a-specific-index-based-on-a-field-value-via/m-p/192158#M38308</guid>
      <dc:creator>IngloriousSplun</dc:creator>
      <dc:date>2015-08-25T15:14:01Z</dc:date>
    </item>
    <item>
      <title>Re: Routing events to a specific index based on a field value via transforms and props not working as expected</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Routing-events-to-a-specific-index-based-on-a-field-value-via/m-p/192159#M38309</link>
      <description>&lt;P&gt;What is the stanza for your inputs.conf?&lt;/P&gt;

&lt;P&gt;Can you run a btool on the sourcetype? Make sure the reRouteMe applies to the sourcetype.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;$SPLUNK_HOME/bin/splunk btool list props sourcetypeA --debug&lt;/CODE&gt; Will show (with file paths) the configurations applied to the sourcetype. So if the &lt;CODE&gt;inputs.conf&lt;/CODE&gt; sourcetype matches the &lt;CODE&gt;props.conf&lt;/CODE&gt; sourcetype, and btool reports it correctly, this should work. I verified the config in my test environment, so I know what you have listed will work.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2015 12:24:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Routing-events-to-a-specific-index-based-on-a-field-value-via/m-p/192159#M38309</guid>
      <dc:creator>alacercogitatus</dc:creator>
      <dc:date>2015-08-26T12:24:05Z</dc:date>
    </item>
    <item>
      <title>Re: Routing events to a specific index based on a field value via transforms and props not working as expected</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Routing-events-to-a-specific-index-based-on-a-field-value-via/m-p/192160#M38310</link>
      <description>&lt;P&gt;inputs.conf in &lt;CODE&gt;$SPLUNK_HOME/etc/apps/search/local&lt;/CODE&gt; has all of my custom defined data inputs.  This one in particular is &lt;CODE&gt;[udp://515]&lt;/CODE&gt; and lists:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[udp://515]
index = indexA
source = sourceA
sourcetype = sourcetypeA
connection_host = dns
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That being said, should this inputs.conf be located elsewhere, such as in &lt;CODE&gt;$SPLUNK_HOME/etc/system/local&lt;/CODE&gt; where the props.conf and transforms.conf are located, or should I move props and transforms to be with this inputs?  I wouldn't think it matters honestly.&lt;/P&gt;

&lt;P&gt;If I run &lt;CODE&gt;btool&lt;/CODE&gt; as you suggested it pulls props from &lt;CODE&gt;$SPLUNK_HOME/etc/system/local&lt;/CODE&gt; and &lt;CODE&gt;$SPLUNK_HOME/etc/system/default&lt;/CODE&gt;, but the transforms it refers to is from &lt;CODE&gt;$SPLUNK_HOME/etc/system/local&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2015 14:02:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Routing-events-to-a-specific-index-based-on-a-field-value-via/m-p/192160#M38310</guid>
      <dc:creator>IngloriousSplun</dc:creator>
      <dc:date>2015-08-26T14:02:53Z</dc:date>
    </item>
    <item>
      <title>Re: Routing events to a specific index based on a field value via transforms and props not working as expected</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Routing-events-to-a-specific-index-based-on-a-field-value-via/m-p/192161#M38311</link>
      <description>&lt;P&gt;Do you have a sample event (sanatized) that you can share? all of these things should be working.  You can keep them in system/local, that's fine for now. &lt;/P&gt;

&lt;P&gt;Join us on IRC, #splunk on efnet.org, and we can discuss real-time what and how. &lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2015 19:33:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Routing-events-to-a-specific-index-based-on-a-field-value-via/m-p/192161#M38311</guid>
      <dc:creator>alacercogitatus</dc:creator>
      <dc:date>2015-08-26T19:33:06Z</dc:date>
    </item>
    <item>
      <title>Re: Routing events to a specific index based on a field value via transforms and props not working as expected</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Routing-events-to-a-specific-index-based-on-a-field-value-via/m-p/506798#M86259</link>
      <description>&lt;P&gt;Could you do it using props and transforms?&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jun 2020 23:21:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Routing-events-to-a-specific-index-based-on-a-field-value-via/m-p/506798#M86259</guid>
      <dc:creator>rmanrique</dc:creator>
      <dc:date>2020-06-30T23:21:13Z</dc:date>
    </item>
  </channel>
</rss>

