<?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 Send events from TA to different indexes depending on hostname in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Send-events-from-TA-to-different-indexes-depending-on-hostname/m-p/377996#M68360</link>
    <description>&lt;P&gt;Hi Splunkers.&lt;/P&gt;

&lt;P&gt;What approach are people using to send events from a TA to different indexes depending on what the hostname?&lt;/P&gt;

&lt;P&gt;For example:&lt;/P&gt;

&lt;P&gt;We have the Splunk_TA_nix addon deployed out to our Linux machines.&lt;BR /&gt;
We want the same source events pulled in for all of our Linux machines but need the events going to different indexes depending on the host name.  For reasons of access/security we need the hosts sending to an index specific that hosts environment&lt;/P&gt;

&lt;P&gt;i.e. for a given source:&lt;BR /&gt;
- host1a, host1b and host1c sends events to "normal_index"&lt;BR /&gt;
- host2a, host2b and host2c sends events to "secure_index"&lt;/P&gt;

&lt;P&gt;Our goal here is to avoid having to maintain multiple Linux TAs, with the only difference being the "index = " line in the inputs.conf.&lt;BR /&gt;
I realise this could be done by copying the TA to a different directory name and updating the index.conf in one of them to use a different index name but code inside the TA seems to expect the TA to sit in a directory of "TA_Splunk_nix" and would break if running inside a differently-named directory.&lt;/P&gt;

&lt;P&gt;I don't want to manually change the directory name in the code as this makes upgrading the TA a nightmare.&lt;/P&gt;

&lt;P&gt;I've seen something similar to this done using whitelists to detect a hostname in the directory of "monitor" stanzas but this doesn't look to be available for "script" stanzas.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;What I am asking:&lt;/STRONG&gt;&lt;BR /&gt;
What method are people using to send events from a TA to different indexes depending on the hostname?&lt;/P&gt;

&lt;P&gt;To clarify: I am &lt;EM&gt;not&lt;/EM&gt; wanting to send an event to multiple indexes from the same host.&lt;BR /&gt;
Thanks.&lt;/P&gt;</description>
    <pubDate>Wed, 30 Sep 2020 01:13:32 GMT</pubDate>
    <dc:creator>torowa</dc:creator>
    <dc:date>2020-09-30T01:13:32Z</dc:date>
    <item>
      <title>Send events from TA to different indexes depending on hostname</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Send-events-from-TA-to-different-indexes-depending-on-hostname/m-p/377996#M68360</link>
      <description>&lt;P&gt;Hi Splunkers.&lt;/P&gt;

&lt;P&gt;What approach are people using to send events from a TA to different indexes depending on what the hostname?&lt;/P&gt;

&lt;P&gt;For example:&lt;/P&gt;

&lt;P&gt;We have the Splunk_TA_nix addon deployed out to our Linux machines.&lt;BR /&gt;
We want the same source events pulled in for all of our Linux machines but need the events going to different indexes depending on the host name.  For reasons of access/security we need the hosts sending to an index specific that hosts environment&lt;/P&gt;

&lt;P&gt;i.e. for a given source:&lt;BR /&gt;
- host1a, host1b and host1c sends events to "normal_index"&lt;BR /&gt;
- host2a, host2b and host2c sends events to "secure_index"&lt;/P&gt;

&lt;P&gt;Our goal here is to avoid having to maintain multiple Linux TAs, with the only difference being the "index = " line in the inputs.conf.&lt;BR /&gt;
I realise this could be done by copying the TA to a different directory name and updating the index.conf in one of them to use a different index name but code inside the TA seems to expect the TA to sit in a directory of "TA_Splunk_nix" and would break if running inside a differently-named directory.&lt;/P&gt;

&lt;P&gt;I don't want to manually change the directory name in the code as this makes upgrading the TA a nightmare.&lt;/P&gt;

&lt;P&gt;I've seen something similar to this done using whitelists to detect a hostname in the directory of "monitor" stanzas but this doesn't look to be available for "script" stanzas.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;What I am asking:&lt;/STRONG&gt;&lt;BR /&gt;
What method are people using to send events from a TA to different indexes depending on the hostname?&lt;/P&gt;

&lt;P&gt;To clarify: I am &lt;EM&gt;not&lt;/EM&gt; wanting to send an event to multiple indexes from the same host.&lt;BR /&gt;
Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 01:13:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Send-events-from-TA-to-different-indexes-depending-on-hostname/m-p/377996#M68360</guid>
      <dc:creator>torowa</dc:creator>
      <dc:date>2020-09-30T01:13:32Z</dc:date>
    </item>
    <item>
      <title>Re: Send events from TA to different indexes depending on hostname</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Send-events-from-TA-to-different-indexes-depending-on-hostname/m-p/377997#M68361</link>
      <description>&lt;P&gt;I suggest you check out the documentation on "Filter event data and send to queues":&lt;/P&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.3.0/Forwarding/Routeandfilterdatad#Filter_event_data_and_send_to_queues"&gt;https://docs.splunk.com/Documentation/Splunk/7.3.0/Forwarding/Routeandfilterdatad#Filter_event_data_and_send_to_queues&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Set your inputs.conf on all your Linux machines to "index = normal_index".&lt;/P&gt;

&lt;P&gt;Now configure routing on your heavy forwarder (or on your indexer if you don't have a heavy forwarder) as follows. props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[host::host2a]
TRANSFORMS-index = set_secure_index
[host::host2b]
TRANSFORMS-index = set_secure_index
...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And transforms.com:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[set_secure_index]
REGEX = .
DEST_KEY = _MetaData:Index
FORMAT = secure_index
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 03 Jul 2019 06:54:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Send-events-from-TA-to-different-indexes-depending-on-hostname/m-p/377997#M68361</guid>
      <dc:creator>whrg</dc:creator>
      <dc:date>2019-07-03T06:54:26Z</dc:date>
    </item>
    <item>
      <title>Re: Send events from TA to different indexes depending on hostname</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Send-events-from-TA-to-different-indexes-depending-on-hostname/m-p/530830#M89327</link>
      <description>&lt;P&gt;Were you able to get this problem resolved?&lt;/P&gt;&lt;P&gt;I am facing the same issue in my environment now and any guidance you may have would be appreciated!&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 14:14:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Send-events-from-TA-to-different-indexes-depending-on-hostname/m-p/530830#M89327</guid>
      <dc:creator>astackpole</dc:creator>
      <dc:date>2020-11-25T14:14:19Z</dc:date>
    </item>
  </channel>
</rss>

