<?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: Using an IP range in Inputs.conf in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Using-an-IP-range-in-Inputs-conf/m-p/101933#M21370</link>
    <description>&lt;P&gt;I do not believe this possible. However, you can redirect inputs to different indexes, just not with inputs.conf. Here is how:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;inputs.conf&lt;/STRONG&gt;  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[tcp://:5000]
connection_host = ip
sourcetype = mixedinputs
index=defaultIndex
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;props.conf&lt;/STRONG&gt;  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[mixedinputs]
TRANSFORM=separate_inputs1, separate_inputs2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;transforms.conf&lt;/STRONG&gt;  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[separate_inputs1]
SOURCE_KEY=MetaData:Host
REGEX=host::192\.168\.1\.1
DEST_KEY=_MetaData:Index
FORMAT=A

[separate_inputs2]
SOURCE_KEY=MetaData:Host
REGEX=host::10\.1\.\d+\.\d+
DEST_KEY=_MetaData:Index
FORMAT=B
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;First, this assigns all inbound events from port 5000 to &lt;CODE&gt;defaultIndex&lt;/CODE&gt; (whatever you want to call it). Then, as the data is processed, each event is examined. If the host field (ip) of an event matches the regular expression (REGEX), the event is reassigned to the index named in FORMAT.&lt;/P&gt;

&lt;P&gt;Note that you can write the REGEX to "wildcard" the octets, but I don't now how to use CIDR notation with regular expressions.&lt;/P&gt;</description>
    <pubDate>Thu, 25 Oct 2012 00:03:16 GMT</pubDate>
    <dc:creator>lguinn2</dc:creator>
    <dc:date>2012-10-25T00:03:16Z</dc:date>
    <item>
      <title>Using an IP range in Inputs.conf</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Using-an-IP-range-in-Inputs-conf/m-p/101932#M21369</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;

&lt;P&gt;I was hoping someone can clarify if an IP range to subnet can be used in Inputs.conf.&lt;/P&gt;

&lt;P&gt;For example all hosts on&lt;/P&gt;

&lt;P&gt;192.168.1.0/24 (192.168.1.0-192.168.1.254) go to index A.&lt;/P&gt;

&lt;P&gt;192.168.2.0/24 (192.168.2.0-192.168.2.254) goes to index B.&lt;/P&gt;

&lt;P&gt;I have read though the documentation but I can't seem to find anything. Also if it is possible what is the correct syntax for the file?&lt;/P&gt;

&lt;P&gt;[tcp://192.168.1.0/24:5000] &lt;/P&gt;

&lt;P&gt;[tcp://192.168.1.0-192.168.1.254:5000]&lt;/P&gt;

&lt;P&gt;If I have missed something in the documentation I apologise.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Oct 2012 21:11:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Using-an-IP-range-in-Inputs-conf/m-p/101932#M21369</guid>
      <dc:creator>bongski</dc:creator>
      <dc:date>2012-10-24T21:11:09Z</dc:date>
    </item>
    <item>
      <title>Re: Using an IP range in Inputs.conf</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Using-an-IP-range-in-Inputs-conf/m-p/101933#M21370</link>
      <description>&lt;P&gt;I do not believe this possible. However, you can redirect inputs to different indexes, just not with inputs.conf. Here is how:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;inputs.conf&lt;/STRONG&gt;  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[tcp://:5000]
connection_host = ip
sourcetype = mixedinputs
index=defaultIndex
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;props.conf&lt;/STRONG&gt;  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[mixedinputs]
TRANSFORM=separate_inputs1, separate_inputs2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;transforms.conf&lt;/STRONG&gt;  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[separate_inputs1]
SOURCE_KEY=MetaData:Host
REGEX=host::192\.168\.1\.1
DEST_KEY=_MetaData:Index
FORMAT=A

[separate_inputs2]
SOURCE_KEY=MetaData:Host
REGEX=host::10\.1\.\d+\.\d+
DEST_KEY=_MetaData:Index
FORMAT=B
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;First, this assigns all inbound events from port 5000 to &lt;CODE&gt;defaultIndex&lt;/CODE&gt; (whatever you want to call it). Then, as the data is processed, each event is examined. If the host field (ip) of an event matches the regular expression (REGEX), the event is reassigned to the index named in FORMAT.&lt;/P&gt;

&lt;P&gt;Note that you can write the REGEX to "wildcard" the octets, but I don't now how to use CIDR notation with regular expressions.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Oct 2012 00:03:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Using-an-IP-range-in-Inputs-conf/m-p/101933#M21370</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2012-10-25T00:03:16Z</dc:date>
    </item>
    <item>
      <title>Re: Using an IP range in Inputs.conf</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Using-an-IP-range-in-Inputs-conf/m-p/101934#M21371</link>
      <description>&lt;P&gt;Thanks for the tip, I will impletment it that way and let you know how I go.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Oct 2012 12:06:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Using-an-IP-range-in-Inputs-conf/m-p/101934#M21371</guid>
      <dc:creator>bongski</dc:creator>
      <dc:date>2012-10-25T12:06:16Z</dc:date>
    </item>
    <item>
      <title>Re: Using an IP range in Inputs.conf</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Using-an-IP-range-in-Inputs-conf/m-p/101935#M21372</link>
      <description>&lt;P&gt;why not just use the index stanza in inputs.conf on the forwarder, should work as well.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Oct 2012 12:33:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Using-an-IP-range-in-Inputs-conf/m-p/101935#M21372</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2012-10-25T12:33:03Z</dc:date>
    </item>
    <item>
      <title>Re: Using an IP range in Inputs.conf</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Using-an-IP-range-in-Inputs-conf/m-p/101936#M21373</link>
      <description>&lt;P&gt;This worked great, the solution is a bit CPU intensive but worked exactly how I needed it to.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Oct 2012 04:58:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Using-an-IP-range-in-Inputs-conf/m-p/101936#M21373</guid>
      <dc:creator>bongski</dc:creator>
      <dc:date>2012-10-29T04:58:42Z</dc:date>
    </item>
    <item>
      <title>Re: Using an IP range in Inputs.conf</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Using-an-IP-range-in-Inputs-conf/m-p/101937#M21374</link>
      <description>&lt;P&gt;Yeah, the event-by-event processing will always cost more resources than the "index the whole input stream from this port" method. There is always a trade-off &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Oct 2012 06:28:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Using-an-IP-range-in-Inputs-conf/m-p/101937#M21374</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2012-10-29T06:28:57Z</dc:date>
    </item>
  </channel>
</rss>

