<?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: How do I route data to specific index based on a field? in Splunk Enterprise</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise/How-do-I-route-data-to-specific-index-based-on-a-field/m-p/77907#M8910</link>
    <description>&lt;P&gt;Ir really works, thanks!&lt;/P&gt;</description>
    <pubDate>Tue, 10 Mar 2015 15:16:38 GMT</pubDate>
    <dc:creator>andrey2007</dc:creator>
    <dc:date>2015-03-10T15:16:38Z</dc:date>
    <item>
      <title>How do I route data to specific index based on a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-do-I-route-data-to-specific-index-based-on-a-field/m-p/77902#M8905</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I would like to know how to route data to a specific index based on a value in a field.&lt;/P&gt;

&lt;P&gt;I have a series of data that look like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2012/06/07 10:45:50 service=srvc1 server=node3 score=50 seq=55041
2012/06/07 10:45:50 service=srvc3 server=node1 score=17 seq=55042
2012/06/07 10:45:50 service=srvc2 server=node1 score=67 seq=55043
2012/06/07 10:45:50 service=srvc2 server=node4 score=43 seq=55044
2012/06/07 10:45:50 service=srvc3 server=node2 score=11 seq=55045
2012/06/07 10:45:50 service=srvc3 server=node2 score=60 seq=55046
2012/06/07 10:45:50 service=srvc1 server=node0 score=28 seq=55047
2012/06/07 10:45:50 service=srvc1 server=node0 score=4 seq=55048
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then, I want to route date to srvc1, srvc2 or srvc3 depending on the value in service field.&lt;BR /&gt;
I found several answers that explains how to route data based on host or source(IP), but I could not find an answer for my questions.&lt;/P&gt;

&lt;P&gt;I really appreciate any comment on this...&lt;/P&gt;

&lt;P&gt;Thank you,&lt;/P&gt;

&lt;P&gt;(JA) イベントの任意のフィールドの値に基づいて保存するIndexを変えるにはどうするのか。&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2012 14:28:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-do-I-route-data-to-specific-index-based-on-a-field/m-p/77902#M8905</guid>
      <dc:creator>melonman</dc:creator>
      <dc:date>2012-06-18T14:28:54Z</dc:date>
    </item>
    <item>
      <title>Re: How do I route data to specific index based on a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-do-I-route-data-to-specific-index-based-on-a-field/m-p/77903#M8906</link>
      <description>&lt;P&gt;You need to use a transforms as follows:&lt;/P&gt;

&lt;P&gt;In props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[host::(host1|host2|host3)]
TRANSFORMS-index1            = index_srvc1
TRANSFORMS-index2            = index_srvc2
TRANSFORMS-index3            = index_srvc3
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and/or&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[some_sourcetype]
TRANSFORMS-index1            = index_srvc1
TRANSFORMS-index2            = index_srvc2
TRANSFORMS-index3            = index_srvc3
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[index_srvc1]
REGEX    = .*service=srvc1.*
DEST_KEY = _MetaData:Index
FORMAT   = srvc1

[index_srvc2]
REGEX    = .*service=srvc2.*
DEST_KEY = _MetaData:Index
FORMAT   = srvc2

[index_srvc3]
REGEX    = .*service=srvc3.*
DEST_KEY = _MetaData:Index
FORMAT   = srvc3
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In my case I needed to base on host from a centralized rsyslog server. YMMV... you may be able to use a replacement expression instead of a separate transform for each index, but I'll leave that as an exercise for you.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2012 15:08:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-do-I-route-data-to-specific-index-based-on-a-field/m-p/77903#M8906</guid>
      <dc:creator>jeff</dc:creator>
      <dc:date>2012-06-18T15:08:49Z</dc:date>
    </item>
    <item>
      <title>Re: How do I route data to specific index based on a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-do-I-route-data-to-specific-index-based-on-a-field/m-p/77904#M8907</link>
      <description>&lt;P&gt;Thanks, I could make my config work.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jun 2012 03:02:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-do-I-route-data-to-specific-index-based-on-a-field/m-p/77904#M8907</guid>
      <dc:creator>melonman</dc:creator>
      <dc:date>2012-06-19T03:02:22Z</dc:date>
    </item>
    <item>
      <title>Re: How do I route data to specific index based on a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-do-I-route-data-to-specific-index-based-on-a-field/m-p/77905#M8908</link>
      <description>&lt;P&gt;Hi jeff,&lt;/P&gt;

&lt;P&gt;I could get it work with the following config.&lt;/P&gt;

&lt;P&gt;-- props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[sample1]
TRANSFORMS-index_routing = route_data_to_index_by_field_service
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;-- transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[route_data_to_index_by_field_service]
REGEX = .*service=(.*?)[ ]
DEST_KEY = _MetaData:Index
FORMAT = $1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;-- Result&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;$ ./splunk search 'index=* sourcetype=sample1 | head limit=10 | table index, service, server'
index service server
----- ------- ------
srvc2 srvc2   node1
srvc2 srvc2   node0
srvc3 srvc3   node1
srvc2 srvc2   node4
srvc3 srvc3   node0
srvc2 srvc2   node4
srvc2 srvc2   node0
srvc1 srvc1   node4
srvc2 srvc2   node1
srvc1 srvc1   node0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;UL&gt;
&lt;LI&gt;now I can move forward to configure RBAC thing... thanks!&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Tue, 19 Jun 2012 03:03:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-do-I-route-data-to-specific-index-based-on-a-field/m-p/77905#M8908</guid>
      <dc:creator>melonman</dc:creator>
      <dc:date>2012-06-19T03:03:34Z</dc:date>
    </item>
    <item>
      <title>Re: How do I route data to specific index based on a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-do-I-route-data-to-specific-index-based-on-a-field/m-p/77906#M8909</link>
      <description>&lt;P&gt;cool... glad I could help. Thanks for posting your regex- may have a use for that later.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jun 2012 02:03:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-do-I-route-data-to-specific-index-based-on-a-field/m-p/77906#M8909</guid>
      <dc:creator>jeff</dc:creator>
      <dc:date>2012-06-20T02:03:26Z</dc:date>
    </item>
    <item>
      <title>Re: How do I route data to specific index based on a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-do-I-route-data-to-specific-index-based-on-a-field/m-p/77907#M8910</link>
      <description>&lt;P&gt;Ir really works, thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2015 15:16:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-do-I-route-data-to-specific-index-based-on-a-field/m-p/77907#M8910</guid>
      <dc:creator>andrey2007</dc:creator>
      <dc:date>2015-03-10T15:16:38Z</dc:date>
    </item>
    <item>
      <title>Re: How do I route data to specific index based on a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-do-I-route-data-to-specific-index-based-on-a-field/m-p/77908#M8911</link>
      <description>&lt;P&gt;Hello, splunkers&lt;BR /&gt;
Have you tryed method described above when you recieve data from forwarder?&lt;BR /&gt;
with local file it works but in case of forwarder and indexer does not.&lt;BR /&gt;
I put transforms.conf and props.conf on indexer may be I do something wrong&lt;/P&gt;</description>
      <pubDate>Mon, 30 Mar 2015 13:27:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-do-I-route-data-to-specific-index-based-on-a-field/m-p/77908#M8911</guid>
      <dc:creator>andrey2007</dc:creator>
      <dc:date>2015-03-30T13:27:22Z</dc:date>
    </item>
    <item>
      <title>Re: How do I route data to specific index based on a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-do-I-route-data-to-specific-index-based-on-a-field/m-p/77909#M8912</link>
      <description>&lt;P&gt;If you want to do somthing by using transforms.conf and props.conf, you need to use "Splunk Enterprise" as "Heavy Forwarder". It means, "just use Splunk Enterprise and make it send data to indexers".&lt;/P&gt;

&lt;P&gt;Be carefull. "Splunk Forwarder" which is different binary from "Enterprise Splunk" can't do anything by using "props.con and transforms.conf".&lt;/P&gt;</description>
      <pubDate>Mon, 30 Mar 2015 16:20:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-do-I-route-data-to-specific-index-based-on-a-field/m-p/77909#M8912</guid>
      <dc:creator>tkomatsubara_sp</dc:creator>
      <dc:date>2015-03-30T16:20:34Z</dc:date>
    </item>
    <item>
      <title>Re: How do I route data to specific index based on a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-do-I-route-data-to-specific-index-based-on-a-field/m-p/77910#M8913</link>
      <description>&lt;P&gt;Thanks, really I use HF which parses my data so I can do nothing with them on indexer&lt;/P&gt;</description>
      <pubDate>Tue, 31 Mar 2015 11:45:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-do-I-route-data-to-specific-index-based-on-a-field/m-p/77910#M8913</guid>
      <dc:creator>andrey2007</dc:creator>
      <dc:date>2015-03-31T11:45:23Z</dc:date>
    </item>
  </channel>
</rss>

