<?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: Can't route forwarded data to different index? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Can-t-route-forwarded-data-to-different-index/m-p/12533#M945</link>
    <description>&lt;P&gt;Thanks alot, got it to work!&lt;BR /&gt;
First one doesn't exactly work. It really adds new _index field to data, but doesn't delete old one. So I end up having two _index fields, but only first _index field is used to store data, and second one seems to get ignored.&lt;/P&gt;

&lt;P&gt;Second one works great if i write it like this:&lt;BR /&gt;
[routeIndex]&lt;BR /&gt;
SOURCE_KEY = MetaData:Sourcetype&lt;BR /&gt;
REGEX=(.*)&lt;BR /&gt;
DEST_KEY=_MetaData:Index&lt;BR /&gt;
FORMAT=test_2&lt;BR /&gt;
WRITE_META=true&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 09:12:10 GMT</pubDate>
    <dc:creator>gljiva</dc:creator>
    <dc:date>2020-09-28T09:12:10Z</dc:date>
    <item>
      <title>Can't route forwarded data to different index?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-t-route-forwarded-data-to-different-index/m-p/12531#M943</link>
      <description>&lt;P&gt;Hi, i saw many suggestions to routing data to different index from light forwarder but none seems to work. 
I have set up light forwarder that sends cooked data to my indexer. Connection is ok, because data gets indexed but in wrong index.&lt;/P&gt;

&lt;P&gt;Here are some of configurations i have tried (on indexer side):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;inputs.conf 
[splunktcp://9997]
index = test_2

Next one:
inputs.conf 
[splunktcp://9997]

props.conf
[host::Simpson-test]
index = test_2
TRANSFORMS-foo = routeIndex

transforms.conf
[routeIndex]
SOURCE_KEY = source
REGEX = = WinEventLog
DEST_KEY =_MetaData:Index
FORMAT = test_2

Next one:
inputs.conf 
[splunktcp://9997]
sourcetype=REMOTE

props.conf
[REMOTE]
TRANSFORMS-simremote = sremote

transforms.conf
[sremote]
REGEX = .
DEST_KEY = _MetaData:Index
FORMAT = test_2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Data allways ends up in index that was defined on lightforwarder (test_1).
I would like to route data that comes to indexer based on sourcetype and host. Data comes from lightforwarder and is cooked so i suppose that sourcetype and host allready exist and i can do REGEX search on SOURCE_KEY? &lt;/P&gt;

&lt;P&gt;Any hints abouth troubleshooting this?&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2010 04:52:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-t-route-forwarded-data-to-different-index/m-p/12531#M943</guid>
      <dc:creator>gljiva</dc:creator>
      <dc:date>2010-04-29T04:52:16Z</dc:date>
    </item>
    <item>
      <title>Re: Can't route forwarded data to different index?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-t-route-forwarded-data-to-different-index/m-p/12532#M944</link>
      <description>&lt;P&gt;The light forwarder can send to a specific index if you set the destination index in inputs.conf on the forwarder itself.  This can be overridden at the indexer using props.conf/transforms.conf for a specific host or sourcetype.&lt;/P&gt;

&lt;P&gt;props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[myfavoritesourcetype]
    TRANSFORMS-index=sendtomyindex
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[sendtomyindex]
SOURCE_KEY=MetaData:Sourcetype
REGEX=(.*)
FORMAT=index::myindex
WRITE_META=true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Update: it looks like this works just as well.  I'm not sure which is preferable...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[sendtomyindex]
SOURCE_KEY=_MetaData:Index
DEST_KEY=_MetaData:Index
REGEX=(.*)
FORMAT=myindex
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 29 Apr 2010 06:27:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-t-route-forwarded-data-to-different-index/m-p/12532#M944</guid>
      <dc:creator>dwaddle</dc:creator>
      <dc:date>2010-04-29T06:27:18Z</dc:date>
    </item>
    <item>
      <title>Re: Can't route forwarded data to different index?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-t-route-forwarded-data-to-different-index/m-p/12533#M945</link>
      <description>&lt;P&gt;Thanks alot, got it to work!&lt;BR /&gt;
First one doesn't exactly work. It really adds new _index field to data, but doesn't delete old one. So I end up having two _index fields, but only first _index field is used to store data, and second one seems to get ignored.&lt;/P&gt;

&lt;P&gt;Second one works great if i write it like this:&lt;BR /&gt;
[routeIndex]&lt;BR /&gt;
SOURCE_KEY = MetaData:Sourcetype&lt;BR /&gt;
REGEX=(.*)&lt;BR /&gt;
DEST_KEY=_MetaData:Index&lt;BR /&gt;
FORMAT=test_2&lt;BR /&gt;
WRITE_META=true&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 09:12:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-t-route-forwarded-data-to-different-index/m-p/12533#M945</guid>
      <dc:creator>gljiva</dc:creator>
      <dc:date>2020-09-28T09:12:10Z</dc:date>
    </item>
    <item>
      <title>Re: Can't route forwarded data to different index?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-t-route-forwarded-data-to-different-index/m-p/12534#M946</link>
      <description>&lt;P&gt;Interesting, I tried both of these (and some variations that didn't work) and only saw one "index" field in each case.  But then again, I'm struggling to see "_index" in the UI.  How are you seeing that?&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2010 18:26:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-t-route-forwarded-data-to-different-index/m-p/12534#M946</guid>
      <dc:creator>dwaddle</dc:creator>
      <dc:date>2010-04-29T18:26:30Z</dc:date>
    </item>
    <item>
      <title>Re: Can't route forwarded data to different index?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-t-route-forwarded-data-to-different-index/m-p/12535#M947</link>
      <description>&lt;P&gt;Side note on your regex:  You should be able to use &lt;CODE&gt;REGEX=.?&lt;/CODE&gt;, which should be more efficient way to say match-all.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2010 20:52:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-t-route-forwarded-data-to-different-index/m-p/12535#M947</guid>
      <dc:creator>Lowell</dc:creator>
      <dc:date>2010-04-29T20:52:34Z</dc:date>
    </item>
    <item>
      <title>Re: Can't route forwarded data to different index?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-t-route-forwarded-data-to-different-index/m-p/12536#M948</link>
      <description>&lt;P&gt;The easiest way is to specify the index in inputs.conf on the forwarder.&lt;/P&gt;

&lt;P&gt;It seemed counter-intuitive to me at first, as if I was directing the forwarder to index something locally. But data is sent along to the indexer and placed into the desired index (as defined in an indexes.conf on the indexer).&lt;/P&gt;

&lt;P&gt;On the forwarder, inputs.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[monitor:///filename/or/other/input/type/]
disabled = false
index=ghtest5
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 13 May 2010 06:05:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-t-route-forwarded-data-to-different-index/m-p/12536#M948</guid>
      <dc:creator>Jason</dc:creator>
      <dc:date>2010-05-13T06:05:01Z</dc:date>
    </item>
  </channel>
</rss>

