<?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: Best way to filter clientips as internal/external and group them by class in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Best-way-to-filter-clientips-as-internal-external-and-group-them/m-p/54453#M13305</link>
    <description>&lt;P&gt;Hi, I was reading thru this and is very helpful. One question i have is, you have mentioned match_type=CIDR(clientip). If i want to mention clientips of both types in the same file, how can i do that? meaning some are regular IPs and some are CIDR blocks..The version i have is - version 5.0.2.3&lt;/P&gt;</description>
    <pubDate>Sat, 22 Jun 2013 20:09:52 GMT</pubDate>
    <dc:creator>xvxt006</dc:creator>
    <dc:date>2013-06-22T20:09:52Z</dc:date>
    <item>
      <title>Best way to filter clientips as internal/external and group them by class</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Best-way-to-filter-clientips-as-internal-external-and-group-them/m-p/54450#M13302</link>
      <description>&lt;P&gt;Given a set of clientip values from internal IP's, external IP's, as well as different classes of internal networks on different interfaces...&lt;/P&gt;

&lt;P&gt;a) what's the cleanest and most efficient way to classify each clientip as internal/external? &lt;/P&gt;

&lt;P&gt;and &lt;/P&gt;

&lt;P&gt;b) what's the best way to put an actual class=A, class=B class=C field in there? &lt;/P&gt;</description>
      <pubDate>Sat, 05 Mar 2011 10:03:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Best-way-to-filter-clientips-as-internal-external-and-group-them/m-p/54450#M13302</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2011-03-05T10:03:07Z</dc:date>
    </item>
    <item>
      <title>Re: Best way to filter clientips as internal/external and group them by class</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Best-way-to-filter-clientips-as-internal-external-and-group-them/m-p/54451#M13303</link>
      <description>&lt;P&gt;In 4.0 and 4.1, the best way to classify a field, like clientip is through eventtypes. For example, in splunk's own app to monitor the splunk.com website we use eventtypes like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[clientip-internal]
search = clientip=64.127.105.32/27

[clientip-nonroutable]
search = clientip=10.0.0.0/8 OR clientip=172.16.0.0/12 OR clientip=192.168.0.0/16

[clientip-public]
search = eventtype!=clientip-internal eventtype!=clientip-nonroutable
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;With these, you can construct a field like clientip_class through the search fragment: &lt;CODE&gt;... | eval clientip_class = mvfilter(clientip LIKE "clientip-%") | ...&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Now, another alternative is to use scripted lookups, since native lookup tables don't support CIDR netblocks or wildcards in 4.0 and 4.1.&lt;/P&gt;

&lt;P&gt;In 4.2, the best practice is to use lookup tables. For example, in transforms.conf add:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[ipdomain]
filename = clientipclass.csv
match_type = CIDR(clientip)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And in clientipclass.csv have:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;clientip,class
10.0.0.0/8,internal
172.16.0.0/12,internal
192.168.0.0/16,internal
64.127.105.32/27,corporate
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Of course, in this case you'll have to set min_matches and default_value in transforms.conf to fill in the default of external.&lt;/P&gt;</description>
      <pubDate>Sat, 05 Mar 2011 11:52:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Best-way-to-filter-clientips-as-internal-external-and-group-them/m-p/54451#M13303</guid>
      <dc:creator>Stephen_Sorkin</dc:creator>
      <dc:date>2011-03-05T11:52:19Z</dc:date>
    </item>
    <item>
      <title>Re: Best way to filter clientips as internal/external and group them by class</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Best-way-to-filter-clientips-as-internal-external-and-group-them/m-p/54452#M13304</link>
      <description>&lt;P&gt;Thanks a ton. I knew some little bits of it but I was hoping someone would write it all up and you came through huge. &lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 05 Mar 2011 13:24:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Best-way-to-filter-clientips-as-internal-external-and-group-them/m-p/54452#M13304</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2011-03-05T13:24:32Z</dc:date>
    </item>
    <item>
      <title>Re: Best way to filter clientips as internal/external and group them by class</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Best-way-to-filter-clientips-as-internal-external-and-group-them/m-p/54453#M13305</link>
      <description>&lt;P&gt;Hi, I was reading thru this and is very helpful. One question i have is, you have mentioned match_type=CIDR(clientip). If i want to mention clientips of both types in the same file, how can i do that? meaning some are regular IPs and some are CIDR blocks..The version i have is - version 5.0.2.3&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jun 2013 20:09:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Best-way-to-filter-clientips-as-internal-external-and-group-them/m-p/54453#M13305</guid>
      <dc:creator>xvxt006</dc:creator>
      <dc:date>2013-06-22T20:09:52Z</dc:date>
    </item>
  </channel>
</rss>

