<?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 to forward events to different indexes based on universal forwarder IP address? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-forward-events-to-different-indexes-based-on-universal/m-p/150463#M30587</link>
    <description>&lt;P&gt;If you have control over the UF configuration, (either directly, or through a configuration management solution or a Deployment Server) then you can set index in inputs.conf on the UFs and you're all set.&lt;/P&gt;

&lt;P&gt;Alternatively, it would take some processing on the HF, you would need some common field to match on the HF (host might be a good one so long as your UF isn't setting host from another source other than the UF itself) so your &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.3/Admin/Propsconf"&gt;props.conf&lt;/A&gt; on the HF could have stanza(s) like: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[host::hostnamepattern]
TRANSFORMS = rewrite-index
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;which of course references corresponding &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.3/Admin/transformsconf"&gt;transforms.conf&lt;/A&gt; entr(ies) like: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[rewrite-index]
SOURCE_KEY = MetaData:Host
REGEX = (regex match against SOURCE_KEY value)
DEST_KEY = _MetaData:Index
FORMAT = targetindex (could use capturing groups from the regex here)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;There's a lot of variability here of course, and if you're using INDEXED_EXTRACTIONS on your UFs, this method of HF configuration wouldn't work (since the UFs are sending fully parsed events in that case). &lt;/P&gt;</description>
    <pubDate>Sun, 14 Jun 2015 17:01:28 GMT</pubDate>
    <dc:creator>acharlieh</dc:creator>
    <dc:date>2015-06-14T17:01:28Z</dc:date>
    <item>
      <title>How to forward events to different indexes based on universal forwarder IP address?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-forward-events-to-different-indexes-based-on-universal/m-p/150462#M30586</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;

&lt;P&gt;I have dozens of devices forwarding data through universal forwarder to a heavy forwarder, which in turn forwards data to a group of indexers. &lt;BR /&gt;
Due to access provisioning demands, I would like data from each set of these devices to be indexed under a specific index, so users can be granted access to the specific indexes.&lt;/P&gt;

&lt;P&gt;By specifying in props.conf and inputs.conf on the heavy forwarder, is it possible to achieve this result? &lt;/P&gt;

&lt;P&gt;Any help would be much appreciated.&lt;BR /&gt;
Splunk newbie.&lt;/P&gt;</description>
      <pubDate>Sun, 14 Jun 2015 14:43:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-forward-events-to-different-indexes-based-on-universal/m-p/150462#M30586</guid>
      <dc:creator>securityninja</dc:creator>
      <dc:date>2015-06-14T14:43:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to forward events to different indexes based on universal forwarder IP address?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-forward-events-to-different-indexes-based-on-universal/m-p/150463#M30587</link>
      <description>&lt;P&gt;If you have control over the UF configuration, (either directly, or through a configuration management solution or a Deployment Server) then you can set index in inputs.conf on the UFs and you're all set.&lt;/P&gt;

&lt;P&gt;Alternatively, it would take some processing on the HF, you would need some common field to match on the HF (host might be a good one so long as your UF isn't setting host from another source other than the UF itself) so your &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.3/Admin/Propsconf"&gt;props.conf&lt;/A&gt; on the HF could have stanza(s) like: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[host::hostnamepattern]
TRANSFORMS = rewrite-index
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;which of course references corresponding &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.3/Admin/transformsconf"&gt;transforms.conf&lt;/A&gt; entr(ies) like: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[rewrite-index]
SOURCE_KEY = MetaData:Host
REGEX = (regex match against SOURCE_KEY value)
DEST_KEY = _MetaData:Index
FORMAT = targetindex (could use capturing groups from the regex here)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;There's a lot of variability here of course, and if you're using INDEXED_EXTRACTIONS on your UFs, this method of HF configuration wouldn't work (since the UFs are sending fully parsed events in that case). &lt;/P&gt;</description>
      <pubDate>Sun, 14 Jun 2015 17:01:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-forward-events-to-different-indexes-based-on-universal/m-p/150463#M30587</guid>
      <dc:creator>acharlieh</dc:creator>
      <dc:date>2015-06-14T17:01:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to forward events to different indexes based on universal forwarder IP address?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-forward-events-to-different-indexes-based-on-universal/m-p/150464#M30588</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
Thank you very much for your detailed answer.&lt;BR /&gt;
Here are the changes I have done.&lt;/P&gt;

&lt;P&gt;/opt/splunk/etc/system/local/props.conf:&lt;BR /&gt;
[host::SALSABDCO101]&lt;BR /&gt;
TRANSFORMS-dc_mog_qatar_cn = dc_mog_qatar_tn&lt;/P&gt;

&lt;P&gt;/opt/splunk/etc/system/local/transforms.conf:&lt;BR /&gt;
[dc_mog_qatar_tn]&lt;BR /&gt;
REGEX = .*&lt;BR /&gt;
DEST_KEY = _MetaData:Index&lt;BR /&gt;
FORMAT = idx_dc_do_mog&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;These changes were done on both the indexers which are involved in indexing events from the host in question.&lt;/LI&gt;
&lt;LI&gt;SALSABDCO101 is the host running the UF whose events I would like to be indexed into idx_dc_do_mog&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Am I doing something incorrect, because I see events from host SALSABDCO101 being indexed into the index defined in inputs.conf under the domain controller app on the heavy forwarder.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 20:16:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-forward-events-to-different-indexes-based-on-universal/m-p/150464#M30588</guid>
      <dc:creator>securityninja</dc:creator>
      <dc:date>2020-09-28T20:16:15Z</dc:date>
    </item>
  </channel>
</rss>

