<?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 Route to index based on source IP/Dest IP in log (Not source host) in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Route-to-index-based-on-source-IP-Dest-IP-in-log-Not-source-host/m-p/376440#M95261</link>
    <description>&lt;P&gt;I cannot seem to get this to work so I assume I am doing something wrong.  We are about to start a POC for splunk but we wanted to get a head start on some of our use cases.  &lt;/P&gt;

&lt;P&gt;We need to route specific data coming in to different indexes for our clients.  Proxy and Firewall logs. The actual host sending us the logs could be the same for 100 clients so we need to do the routing based on Source or Dest with in the log.  &lt;/P&gt;

&lt;P&gt;Samples are below.  But we basically want to route that data into the index called 1000.  We would then want to make more that does different regex for other CIDR ranges.  From what I am reading, this appears it should be at least close to what I want. &lt;/P&gt;

&lt;P&gt;Props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    [cisco:asa]
    TRANSFORMS-1000 = 1000cisco
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[1000cisco]
REGEX = :10\.1\.([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))\.([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))
DEST_KEY = _MetaData:Index
FORMAT = 1000
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Sample Log&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;172&amp;gt;May 16 10:51:17 hostip %ASA-4-106023: Deny tcp src fwinterface:10.1.1.57/64176 dst outside:172.217.7.14/443(cloud.google.com) by access-group "aclname" [0x0, 0x0]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 16 May 2019 15:03:13 GMT</pubDate>
    <dc:creator>seankoniarz</dc:creator>
    <dc:date>2019-05-16T15:03:13Z</dc:date>
    <item>
      <title>Route to index based on source IP/Dest IP in log (Not source host)</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Route-to-index-based-on-source-IP-Dest-IP-in-log-Not-source-host/m-p/376440#M95261</link>
      <description>&lt;P&gt;I cannot seem to get this to work so I assume I am doing something wrong.  We are about to start a POC for splunk but we wanted to get a head start on some of our use cases.  &lt;/P&gt;

&lt;P&gt;We need to route specific data coming in to different indexes for our clients.  Proxy and Firewall logs. The actual host sending us the logs could be the same for 100 clients so we need to do the routing based on Source or Dest with in the log.  &lt;/P&gt;

&lt;P&gt;Samples are below.  But we basically want to route that data into the index called 1000.  We would then want to make more that does different regex for other CIDR ranges.  From what I am reading, this appears it should be at least close to what I want. &lt;/P&gt;

&lt;P&gt;Props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    [cisco:asa]
    TRANSFORMS-1000 = 1000cisco
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[1000cisco]
REGEX = :10\.1\.([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))\.([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))
DEST_KEY = _MetaData:Index
FORMAT = 1000
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Sample Log&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;172&amp;gt;May 16 10:51:17 hostip %ASA-4-106023: Deny tcp src fwinterface:10.1.1.57/64176 dst outside:172.217.7.14/443(cloud.google.com) by access-group "aclname" [0x0, 0x0]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 16 May 2019 15:03:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Route-to-index-based-on-source-IP-Dest-IP-in-log-Not-source-host/m-p/376440#M95261</guid>
      <dc:creator>seankoniarz</dc:creator>
      <dc:date>2019-05-16T15:03:13Z</dc:date>
    </item>
    <item>
      <title>Re: Route to index based on source IP/Dest IP in log (Not source host)</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Route-to-index-based-on-source-IP-Dest-IP-in-log-Not-source-host/m-p/376441#M95262</link>
      <description>&lt;P&gt;Just out of curiosity, Why are you redirecting after you receive the data? You could have specified correct index in inputs.conf if you collect by source ip? i.e. if you have syslog or something, log it based on IP address/hostname, and then index using inputs.conf and send to individual databases as it is very efficient in performance. If you do at props/transforms, Splunk have to check at event level to make that decision&lt;/P&gt;

&lt;P&gt;Said that, your props/transforms seems correct. The only thing is, the regex may be bit complicated and you try &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[1000cisco]
 REGEX = ^.+:10\.1\.([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))\.([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5])).+$
 DEST_KEY = _MetaData:Index
 FORMAT = 1000
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 16 May 2019 20:56:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Route-to-index-based-on-source-IP-Dest-IP-in-log-Not-source-host/m-p/376441#M95262</guid>
      <dc:creator>koshyk</dc:creator>
      <dc:date>2019-05-16T20:56:07Z</dc:date>
    </item>
    <item>
      <title>Re: Route to index based on source IP/Dest IP in log (Not source host)</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Route-to-index-based-on-source-IP-Dest-IP-in-log-Not-source-host/m-p/376442#M95263</link>
      <description>&lt;P&gt;So I might not need to redirect it after receiving the data if that is an option.  But I guess let me better explain the use case. &lt;/P&gt;

&lt;P&gt;We act as an ISP essentially for some clients.  They use traverse our firewalls and out to the internet.  &lt;/P&gt;

&lt;P&gt;1 FW for Multiple clients&lt;/P&gt;

&lt;P&gt;So the source device could be 10.1.1.6.  But that device is going to have multiple client CIDR ranges.  &lt;/P&gt;

&lt;P&gt;10.2.0.0/16 = client1&lt;BR /&gt;
10.3.0.0/16 = client2&lt;BR /&gt;
10.4.0.0/16 = client3&lt;/P&gt;

&lt;P&gt;sample log style&lt;BR /&gt;
Device(sourceHost) source dest&lt;BR /&gt;
1. 10.1.1.6 client1 to google&lt;BR /&gt;
2. 10.1.1.6 client2 to bing&lt;BR /&gt;
3. 10.1.1.6 client3 to amazon&lt;/P&gt;

&lt;P&gt;Log #1 to index client1&lt;BR /&gt;
Log #2 to index client2&lt;BR /&gt;
Log #3 to index client3&lt;/P&gt;

&lt;P&gt;Does that make more sense?  If they all had separate firewalls this would be very simple, but that is not the case.  If I can do this  in a more efficient way I am all about doing that.  &lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2019 22:08:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Route-to-index-based-on-source-IP-Dest-IP-in-log-Not-source-host/m-p/376442#M95263</guid>
      <dc:creator>seankoniarz</dc:creator>
      <dc:date>2019-05-16T22:08:37Z</dc:date>
    </item>
  </channel>
</rss>

