<?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 events to different indexes based on hostname in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Route-events-to-different-indexes-based-on-hostname/m-p/574872#M101594</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231970"&gt;@Abha111&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Will the host name parameter come inside the events as well? If yes. you can simply define a regex in transforms.conf to route it to specific index.&lt;/P&gt;&lt;P&gt;Example below.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;props.conf&lt;/U&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;BR /&gt;[your_sourcetype]&lt;BR /&gt;enter your props&lt;BR /&gt;&lt;FONT color="#008080"&gt;&lt;STRONG&gt;TRANSFORMS-routing=set_nonprod,setprod&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;transforms.conf&lt;/STRONG&gt;&lt;/U&gt;&lt;BR /&gt;[set_nonprod]&lt;BR /&gt;REGEX = &lt;STRONG&gt;&lt;FONT color="#008080"&gt;abc-nprd*&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;DEST_KEY = _MetaData:Index&lt;BR /&gt;FORMAT = index_x&lt;/P&gt;&lt;P&gt;[setprod]&lt;BR /&gt;REGEX = &lt;STRONG&gt;&lt;FONT color="#008080"&gt;abc-prd*&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;DEST_KEY = _MetaData:Index&lt;BR /&gt;FORMAT = index_y&lt;BR /&gt;&lt;BR /&gt;Try this. Let me know for any further questions.&amp;nbsp;If this works, give thumbs-up &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;Happy Splunking!!&amp;nbsp;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 15 Nov 2021 06:48:02 GMT</pubDate>
    <dc:creator>bhargavi</dc:creator>
    <dc:date>2021-11-15T06:48:02Z</dc:date>
    <item>
      <title>Route events to different indexes based on hostname</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Route-events-to-different-indexes-based-on-hostname/m-p/574865#M101592</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to send data to x index if the host is non prod and host name is like abc-nprd* for&amp;nbsp; /var/log&lt;/P&gt;&lt;P&gt;However, would like to send data to y index if host is prod and host name is like abc-prd* for /var/log&lt;/P&gt;&lt;P&gt;Don't want to create multiple apps for prod and non prod. So is there is way I can achieve the above by deploying the same app to prod and non prod.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Nov 2021 02:19:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Route-events-to-different-indexes-based-on-hostname/m-p/574865#M101592</guid>
      <dc:creator>Abha111</dc:creator>
      <dc:date>2021-11-15T02:19:10Z</dc:date>
    </item>
    <item>
      <title>Re: Route events to different indexes based on hostname</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Route-events-to-different-indexes-based-on-hostname/m-p/574872#M101594</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231970"&gt;@Abha111&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Will the host name parameter come inside the events as well? If yes. you can simply define a regex in transforms.conf to route it to specific index.&lt;/P&gt;&lt;P&gt;Example below.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;props.conf&lt;/U&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;BR /&gt;[your_sourcetype]&lt;BR /&gt;enter your props&lt;BR /&gt;&lt;FONT color="#008080"&gt;&lt;STRONG&gt;TRANSFORMS-routing=set_nonprod,setprod&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;transforms.conf&lt;/STRONG&gt;&lt;/U&gt;&lt;BR /&gt;[set_nonprod]&lt;BR /&gt;REGEX = &lt;STRONG&gt;&lt;FONT color="#008080"&gt;abc-nprd*&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;DEST_KEY = _MetaData:Index&lt;BR /&gt;FORMAT = index_x&lt;/P&gt;&lt;P&gt;[setprod]&lt;BR /&gt;REGEX = &lt;STRONG&gt;&lt;FONT color="#008080"&gt;abc-prd*&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;DEST_KEY = _MetaData:Index&lt;BR /&gt;FORMAT = index_y&lt;BR /&gt;&lt;BR /&gt;Try this. Let me know for any further questions.&amp;nbsp;If this works, give thumbs-up &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;Happy Splunking!!&amp;nbsp;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Nov 2021 06:48:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Route-events-to-different-indexes-based-on-hostname/m-p/574872#M101594</guid>
      <dc:creator>bhargavi</dc:creator>
      <dc:date>2021-11-15T06:48:02Z</dc:date>
    </item>
  </channel>
</rss>

