<?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 data to separate index based on CIDR in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Route-data-to-separate-index-based-on-CIDR/m-p/119390#M24816</link>
    <description>&lt;P&gt;This is what I came up with, but not sure if this is going to work:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;props.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[netblock1-ingress]
TRANSFORMS-route = netblock1-ingress

[netblock1-egress]
TRANSFORMS-route = netblock1-egress

[netblock2-ingress]
TRANSFORMS-route = netblock2-ingress

[netblock2-egress]
TRANSFORMS-route = netblock2-egress
&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;[netblock1-ingress]
SOURCE_KEY = _raw
REGEX = (?m)(?:.*\&amp;lt;ip\&amp;gt;)(10\.0\.1\.[0-9]{1,3})
FORMAT = myIndex
DEST_KEY = _MetaData:Index

[netblock1-egress]
SOURCE_KEY = _raw
REGEX = (?m)(?:.*\&amp;lt;ip\&amp;gt;)(10\.0\.1\.[0-9]{1,3})
FORMAT = myIndex
DEST_KEY = _MetaData:Index

[netblock2-ingress]
SOURCE_KEY = _raw
REGEX = (?m)(?:.*\&amp;lt;ip\&amp;gt;)(10\.0\.2\.[0-9]{1,3})
FORMAT = myIndex
DEST_KEY = _MetaData:Index

[netblock2-egress]
SOURCE_KEY = _raw
REGEX = (?m)(?:.*\&amp;lt;ip\&amp;gt;)(10\.0\.2\.[0-9]{1,3})
FORMAT = myIndex
DEST_KEY = _MetaData:Index
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This is what my raw event looks like for XML:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;
&amp;lt;alerts appliance="..." xmlns="..." xmlns:xsi="..."&amp;gt;
  &amp;lt;alert id="12345" name="test-alert"&amp;gt;
    &amp;lt;details ...&amp;gt;
      &amp;lt;content&amp;gt;
      &amp;lt;/content&amp;gt;
    &amp;lt;/details&amp;gt;
    &amp;lt;src vlan="1"&amp;gt;
      &amp;lt;ip&amp;gt;10.0.1.25&amp;lt;/ip&amp;gt;
      &amp;lt;port&amp;gt;&amp;lt;/port&amp;gt;
    &amp;lt;/src&amp;gt;
    &amp;lt;dst&amp;gt;
      &amp;lt;ip&amp;gt;1.2.4.5&amp;lt;/ip&amp;gt;
      &amp;lt;port&amp;gt;&amp;lt;/port&amp;gt;
    &amp;lt;/dst&amp;gt;
  &amp;lt;/alert&amp;gt;
&amp;lt;/alerts&amp;gt;


    &amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;
    &amp;lt;alerts appliance="..." xmlns="..." xmlns:xsi="..."&amp;gt;
      &amp;lt;alert id="12345" name="test-alert"&amp;gt;
        &amp;lt;details ...&amp;gt;
          &amp;lt;content&amp;gt;
          &amp;lt;/content&amp;gt;
        &amp;lt;/details&amp;gt;
        &amp;lt;src vlan="1"&amp;gt;
          &amp;lt;ip&amp;gt;1.2.4.5&amp;lt;/ip&amp;gt;
          &amp;lt;port&amp;gt;&amp;lt;/port&amp;gt;
        &amp;lt;/src&amp;gt;
        &amp;lt;dst&amp;gt;
          &amp;lt;ip&amp;gt;10.0.1.25&amp;lt;/ip&amp;gt;
          &amp;lt;port&amp;gt;&amp;lt;/port&amp;gt;
        &amp;lt;/dst&amp;gt;
      &amp;lt;/alert&amp;gt;
    &amp;lt;/alerts&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thoughts?&lt;/P&gt;</description>
    <pubDate>Tue, 31 Mar 2015 19:28:37 GMT</pubDate>
    <dc:creator>IngloriousSplun</dc:creator>
    <dc:date>2015-03-31T19:28:37Z</dc:date>
    <item>
      <title>Route data to separate index based on CIDR</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Route-data-to-separate-index-based-on-CIDR/m-p/119389#M24815</link>
      <description>&lt;P&gt;I have a requirement to route data that falls within two /24 CIDR ranges to a separate index, say 10.0.1.0/24 and 10.0.2.0/24.  The event traffic does not come from a specific host, however, all of our traffic does aggregate to a common heavy forwarder.  The events coming in are either XML or syslog and each has a specific field that displays the IP, either source or destination such as  or .  &lt;/P&gt;

&lt;P&gt;My thought was to use transforms.conf and props.conf to route the traffic, but I'm not sure how to specify to only route to this index if the IP falls within the two desired /24 CIDR blocks.  &lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Mar 2015 15:22:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Route-data-to-separate-index-based-on-CIDR/m-p/119389#M24815</guid>
      <dc:creator>IngloriousSplun</dc:creator>
      <dc:date>2015-03-31T15:22:19Z</dc:date>
    </item>
    <item>
      <title>Re: Route data to separate index based on CIDR</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Route-data-to-separate-index-based-on-CIDR/m-p/119390#M24816</link>
      <description>&lt;P&gt;This is what I came up with, but not sure if this is going to work:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;props.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[netblock1-ingress]
TRANSFORMS-route = netblock1-ingress

[netblock1-egress]
TRANSFORMS-route = netblock1-egress

[netblock2-ingress]
TRANSFORMS-route = netblock2-ingress

[netblock2-egress]
TRANSFORMS-route = netblock2-egress
&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;[netblock1-ingress]
SOURCE_KEY = _raw
REGEX = (?m)(?:.*\&amp;lt;ip\&amp;gt;)(10\.0\.1\.[0-9]{1,3})
FORMAT = myIndex
DEST_KEY = _MetaData:Index

[netblock1-egress]
SOURCE_KEY = _raw
REGEX = (?m)(?:.*\&amp;lt;ip\&amp;gt;)(10\.0\.1\.[0-9]{1,3})
FORMAT = myIndex
DEST_KEY = _MetaData:Index

[netblock2-ingress]
SOURCE_KEY = _raw
REGEX = (?m)(?:.*\&amp;lt;ip\&amp;gt;)(10\.0\.2\.[0-9]{1,3})
FORMAT = myIndex
DEST_KEY = _MetaData:Index

[netblock2-egress]
SOURCE_KEY = _raw
REGEX = (?m)(?:.*\&amp;lt;ip\&amp;gt;)(10\.0\.2\.[0-9]{1,3})
FORMAT = myIndex
DEST_KEY = _MetaData:Index
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This is what my raw event looks like for XML:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;
&amp;lt;alerts appliance="..." xmlns="..." xmlns:xsi="..."&amp;gt;
  &amp;lt;alert id="12345" name="test-alert"&amp;gt;
    &amp;lt;details ...&amp;gt;
      &amp;lt;content&amp;gt;
      &amp;lt;/content&amp;gt;
    &amp;lt;/details&amp;gt;
    &amp;lt;src vlan="1"&amp;gt;
      &amp;lt;ip&amp;gt;10.0.1.25&amp;lt;/ip&amp;gt;
      &amp;lt;port&amp;gt;&amp;lt;/port&amp;gt;
    &amp;lt;/src&amp;gt;
    &amp;lt;dst&amp;gt;
      &amp;lt;ip&amp;gt;1.2.4.5&amp;lt;/ip&amp;gt;
      &amp;lt;port&amp;gt;&amp;lt;/port&amp;gt;
    &amp;lt;/dst&amp;gt;
  &amp;lt;/alert&amp;gt;
&amp;lt;/alerts&amp;gt;


    &amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;
    &amp;lt;alerts appliance="..." xmlns="..." xmlns:xsi="..."&amp;gt;
      &amp;lt;alert id="12345" name="test-alert"&amp;gt;
        &amp;lt;details ...&amp;gt;
          &amp;lt;content&amp;gt;
          &amp;lt;/content&amp;gt;
        &amp;lt;/details&amp;gt;
        &amp;lt;src vlan="1"&amp;gt;
          &amp;lt;ip&amp;gt;1.2.4.5&amp;lt;/ip&amp;gt;
          &amp;lt;port&amp;gt;&amp;lt;/port&amp;gt;
        &amp;lt;/src&amp;gt;
        &amp;lt;dst&amp;gt;
          &amp;lt;ip&amp;gt;10.0.1.25&amp;lt;/ip&amp;gt;
          &amp;lt;port&amp;gt;&amp;lt;/port&amp;gt;
        &amp;lt;/dst&amp;gt;
      &amp;lt;/alert&amp;gt;
    &amp;lt;/alerts&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thoughts?&lt;/P&gt;</description>
      <pubDate>Tue, 31 Mar 2015 19:28:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Route-data-to-separate-index-based-on-CIDR/m-p/119390#M24816</guid>
      <dc:creator>IngloriousSplun</dc:creator>
      <dc:date>2015-03-31T19:28:37Z</dc:date>
    </item>
    <item>
      <title>Re: Route data to separate index based on CIDR</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Route-data-to-separate-index-based-on-CIDR/m-p/119391#M24817</link>
      <description>&lt;P&gt;Did you get this working?&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2015 02:30:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Route-data-to-separate-index-based-on-CIDR/m-p/119391#M24817</guid>
      <dc:creator>JasonCarter80</dc:creator>
      <dc:date>2015-07-29T02:30:06Z</dc:date>
    </item>
    <item>
      <title>Re: Route data to separate index based on CIDR</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Route-data-to-separate-index-based-on-CIDR/m-p/119392#M24818</link>
      <description>&lt;P&gt;How can I implement the same logic for host. I want to route the events to different indexes based on source and host name. Any suggestion?&lt;/P&gt;</description>
      <pubDate>Tue, 13 Dec 2016 10:00:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Route-data-to-separate-index-based-on-CIDR/m-p/119392#M24818</guid>
      <dc:creator>shan_santosh</dc:creator>
      <dc:date>2016-12-13T10:00:03Z</dc:date>
    </item>
  </channel>
</rss>

