<?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: Route data to index based on host in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Route-data-to-index-based-on-host/m-p/10895#M452</link>
    <description>&lt;P&gt;Another example redirecting Windows event logs using the log channel name:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://answers.splunk.com/questions/970/how-do-i-configure-splunk-to-index-windows-event-log-data-in-separate-indexes" rel="nofollow"&gt;http://answers.splunk.com/questions/970/how-do-i-configure-splunk-to-index-windows-event-log-data-in-separate-indexes&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 08 Apr 2010 08:12:56 GMT</pubDate>
    <dc:creator>Ledio_Ago</dc:creator>
    <dc:date>2010-04-08T08:12:56Z</dc:date>
    <item>
      <title>Route data to index based on host</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Route-data-to-index-based-on-host/m-p/10887#M444</link>
      <description>&lt;P&gt;Hi folks,&lt;/P&gt;

&lt;P&gt;I'd like to route WMI logs to different indexes based off the host name (I have a few environments)&lt;/P&gt;

&lt;P&gt;Going off the directions here: &lt;A href="http://www.splunk.com/support/forum:SplunkAdministration/3468" rel="nofollow"&gt;http://www.splunk.com/support/forum:SplunkAdministration/3468&lt;/A&gt;
I'm not sure why this isn't working.  My data from my remote collected WinEventLog keeps going into 'main'.  Ideas?&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[host::foo*]
TRANSFORMS-foo = route_to_foo
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[route_to_foo]
SOURCE_KEY = _raw
REGEX = (?m)^wmi_type=(WinEventLog:System|WinEventLog:Application)
DEST_KEY = _MetaData:Index
FORMAT = foo
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;EDIT:&lt;/STRONG&gt; Per suggestions this is now working as below&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[wmi]
TRANSFORMS-FIELDS = wmi-host, wmi-source, wmi-sourcetype, wmi-color
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;P&gt;default transform for wmi-host&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[wmi-host]
REGEX = (?m)ComputerName=(.+)
DEST_KEY = MetaData:Host
FORMAT = $1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Environment host names are unique in the three characters after "FOO"
ie for the BAR &amp;amp; BAD environment, host names would be "FOOBAR1", "FOOBAR2", "FOOBAD1", "FOOBAD2"&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[wmi-color]
SOURCE_KEY = MetaData:Host
REGEX = (?m)FOO(.{3})(.+)
DEST_KEY = _MetaData:Index
FORMAT = $1
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 03 Apr 2010 09:04:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Route-data-to-index-based-on-host/m-p/10887#M444</guid>
      <dc:creator>Yancy</dc:creator>
      <dc:date>2010-04-03T09:04:22Z</dc:date>
    </item>
    <item>
      <title>Re: Route data to index based on host</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Route-data-to-index-based-on-host/m-p/10888#M445</link>
      <description>&lt;P&gt;Check the host field of the events in your 'main' index. Make sure it matches with your wildcard in props.conf (foo*).&lt;/P&gt;</description>
      <pubDate>Sat, 03 Apr 2010 15:56:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Route-data-to-index-based-on-host/m-p/10888#M445</guid>
      <dc:creator>Simon</dc:creator>
      <dc:date>2010-04-03T15:56:01Z</dc:date>
    </item>
    <item>
      <title>Re: Route data to index based on host</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Route-data-to-index-based-on-host/m-p/10889#M446</link>
      <description>&lt;P&gt;I would test with a simpler REGEX. It looks like yours might have unmatched parentheses. I'd also try matching on MetaData:Source as your SOURCE_KEY rather than _raw. Seems simpler and would have better performance.&lt;/P&gt;</description>
      <pubDate>Sat, 03 Apr 2010 21:06:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Route-data-to-index-based-on-host/m-p/10889#M446</guid>
      <dc:creator>Dan</dc:creator>
      <dc:date>2010-04-03T21:06:42Z</dc:date>
    </item>
    <item>
      <title>Re: Route data to index based on host</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Route-data-to-index-based-on-host/m-p/10890#M447</link>
      <description>&lt;P&gt;In the case of wmi inputs, unfortunately the source is simply set to "wmi", and is set during the same phase as this TRANSFORM.&lt;/P&gt;</description>
      <pubDate>Sat, 03 Apr 2010 23:12:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Route-data-to-index-based-on-host/m-p/10890#M447</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-04-03T23:12:40Z</dc:date>
    </item>
    <item>
      <title>Re: Route data to index based on host</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Route-data-to-index-based-on-host/m-p/10891#M448</link>
      <description>&lt;P&gt;Oh, yeah, I just thought of another thing while commenting on another answer to this. By default, &lt;CODE&gt;[wmi]&lt;/CODE&gt; sourcetype also does a &lt;CODE&gt;TRANSFORM&lt;/CODE&gt; that sets the host, set in &lt;CODE&gt;etc/system/default/props.conf&lt;/CODE&gt; and &lt;CODE&gt;etc/system/default/transforms.conf&lt;/CODE&gt;. It's likely that it's running &lt;EM&gt;after&lt;/EM&gt; your host one and therefore overwriting your change.&lt;/P&gt;

&lt;P&gt;You might need to override that by setting:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[wmi]
TRANSFORMS-FIELDS = wmi-source, wmi-sourcetype
# the original was TRANSFORMS-FIELDS = wmi-host, wmi-source, wmi-sourcetype
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Update:&lt;/P&gt;

&lt;P&gt;oops sorry, got confused, thought you were trying to update "host" not "index". Ignore the override I said and look at kbains answer.&lt;/P&gt;</description>
      <pubDate>Sat, 03 Apr 2010 23:16:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Route-data-to-index-based-on-host/m-p/10891#M448</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-04-03T23:16:29Z</dc:date>
    </item>
    <item>
      <title>Re: Route data to index based on host</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Route-data-to-index-based-on-host/m-p/10892#M449</link>
      <description>&lt;P&gt;Thanks, I think this is on the right track.. just not quite there yet.&lt;/P&gt;

&lt;P&gt;Overriding the props.conf [wmi] per your suggestion, it now simply leaves the host as the Splunk Server.  Index is still set to 'main'.&lt;/P&gt;

&lt;P&gt;This is on 4.0.10&lt;/P&gt;</description>
      <pubDate>Mon, 05 Apr 2010 22:51:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Route-data-to-index-based-on-host/m-p/10892#M449</guid>
      <dc:creator>Yancy</dc:creator>
      <dc:date>2010-04-05T22:51:16Z</dc:date>
    </item>
    <item>
      <title>Re: Route data to index based on host</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Route-data-to-index-based-on-host/m-p/10893#M450</link>
      <description>&lt;P&gt;since the hostname is extract via a transform stanza itself, you cannot call the routing transform based on host. here are the configuration changes you should make:&lt;/P&gt;

&lt;P&gt;props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[wmi]
TRANSFORMS-FIELDS = wmi-host, wmi-source, wmi-sourcetype, wmi-foo1, wmi-foo2

#notice the wmi-foo1 and wmi-foo2 transforms are called AFTER the wmi-host transform   
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;#make everything from this host go to a different index 
[wmi-foo1]
SOURCE_KEY = MetaData:Host
REGEX = &amp;lt;the host you want to route&amp;gt;
DEST_KEY = _MetaData:Index
FORMAT = foo

#now revert the index for the events you DON'T want to in the foo index for the host
[wmi-foo2]
SOURCE_KEY = _raw
REGEX = &amp;lt;some regex here based on raw text event&amp;gt;
DEST_KEY = _MetaData:Index
FORMAT = &amp;lt;non foo index&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 06 Apr 2010 00:14:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Route-data-to-index-based-on-host/m-p/10893#M450</guid>
      <dc:creator>kbains</dc:creator>
      <dc:date>2010-04-06T00:14:31Z</dc:date>
    </item>
    <item>
      <title>Re: Route data to index based on host</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Route-data-to-index-based-on-host/m-p/10894#M451</link>
      <description>&lt;P&gt;&lt;CODE&gt;FORMAT = index::$1&lt;/CODE&gt; should be &lt;CODE&gt;FORMAT = $1&lt;/CODE&gt; in stanza &lt;CODE&gt;[wmi-color]&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Apr 2010 01:50:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Route-data-to-index-based-on-host/m-p/10894#M451</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-04-06T01:50:31Z</dc:date>
    </item>
    <item>
      <title>Re: Route data to index based on host</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Route-data-to-index-based-on-host/m-p/10895#M452</link>
      <description>&lt;P&gt;Another example redirecting Windows event logs using the log channel name:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://answers.splunk.com/questions/970/how-do-i-configure-splunk-to-index-windows-event-log-data-in-separate-indexes" rel="nofollow"&gt;http://answers.splunk.com/questions/970/how-do-i-configure-splunk-to-index-windows-event-log-data-in-separate-indexes&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Apr 2010 08:12:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Route-data-to-index-based-on-host/m-p/10895#M452</guid>
      <dc:creator>Ledio_Ago</dc:creator>
      <dc:date>2010-04-08T08:12:56Z</dc:date>
    </item>
    <item>
      <title>Re: Route data to index based on host</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Route-data-to-index-based-on-host/m-p/10896#M453</link>
      <description>&lt;P&gt;I'm having a hell of a time with this, and it seems right to continue the thread here instead of posting a nearly identical question.&lt;/P&gt;

&lt;P&gt;"All" I am trying to do is route &lt;EM&gt;ANY&lt;/EM&gt; data (syslog, WMI, whatever ... anything) from host::ats-* to the index 'ats'&lt;/P&gt;

&lt;P&gt;I have tried:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;# props.conf
[host::ats-*]
TRANSFORMS-whatever = ats
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;with&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;# transforms.conf
[ats]
REGEX = .+
DEST_KEY = _MetaData:Index
FORMAT = ats
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and the only thing I see in index=ats is some notifications from the Splunk forwarder(s) on ats-* hosts due to my restarting our main Splunk server.  There is no WMI data showing up in index=ats, as it is all still going to index=main.  This WMI data that I can see in index=main clearly shows fields of host=ats-17.our.org, etc.&lt;/P&gt;

&lt;P&gt;Any advice would greatly be appreciated.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2011 04:08:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Route-data-to-index-based-on-host/m-p/10896#M453</guid>
      <dc:creator>jblaine</dc:creator>
      <dc:date>2011-03-03T04:08:33Z</dc:date>
    </item>
    <item>
      <title>Re: Route data to index based on host</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Route-data-to-index-based-on-host/m-p/10897#M454</link>
      <description>&lt;P&gt;Hi, it's probably a good idea to open a new question and link back to this one, as new questions are much more visible.  This question has been answered, and while your scenario is similar, I'm not quite sure what the next steps would be.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2011 02:45:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Route-data-to-index-based-on-host/m-p/10897#M454</guid>
      <dc:creator>Yancy</dc:creator>
      <dc:date>2011-03-11T02:45:02Z</dc:date>
    </item>
  </channel>
</rss>

