<?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: Lookup in range value in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Lookup-in-range-value/m-p/40312#M9285</link>
    <description>&lt;P&gt;You want to have a lookup table such as:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;IPRange, Area&lt;BR /&gt;
10.0.1.0/24, A&lt;BR /&gt;
10.0.2.0/24, B&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;Then when an event has a field ip=10.0.1.2, add area=A onto the event. I can think of a few ways to do this, not sure which is best based on the specifics of yoru situation.&lt;/P&gt;

&lt;P&gt;1) Change the lookup table to include every IP address and its Area. So instead of 10.0.1.0/24, include 10.0.1.1, 10.0.1.2, 10.0.1.3, .... in the table.&lt;/P&gt;

&lt;P&gt;2) Break the IP address up into 4 sections, and then compare the third section with a lookup table to determine what area the IP is in. So "1"=A, "2"=B, ....&lt;/P&gt;

&lt;P&gt;3) Use "cidrmatch" in your search string to classify IPs instead of usign a lookup table at all.&lt;/P&gt;

&lt;P&gt;3) Use "cidrmatch" in your string to add an additional field to each event that has the range the IP is in as the value. So if the ip is 10.0.1.2, use cidrmatch to add a field/value pair cidr="10.0.1.0/24". Then do the lookup on the field cidr.&lt;/P&gt;</description>
    <pubDate>Fri, 09 Dec 2011 16:18:59 GMT</pubDate>
    <dc:creator>rtadams89</dc:creator>
    <dc:date>2011-12-09T16:18:59Z</dc:date>
    <item>
      <title>Lookup in range value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-in-range-value/m-p/40311#M9284</link>
      <description>&lt;P&gt;Can I use lookup in a range value situation ? For example, the IP address:&lt;BR /&gt;
10.0.1.0/24 for A area&lt;BR /&gt;
10.0.2.0/24 for B area&lt;BR /&gt;
when I input a single ip 10.0.1.2 in search bar，the lookup command will return A area.&lt;BR /&gt;
If this can be done,how to configure it in splunk?&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jul 2011 08:46:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-in-range-value/m-p/40311#M9284</guid>
      <dc:creator>gavintofly</dc:creator>
      <dc:date>2011-07-11T08:46:38Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup in range value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-in-range-value/m-p/40312#M9285</link>
      <description>&lt;P&gt;You want to have a lookup table such as:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;IPRange, Area&lt;BR /&gt;
10.0.1.0/24, A&lt;BR /&gt;
10.0.2.0/24, B&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;Then when an event has a field ip=10.0.1.2, add area=A onto the event. I can think of a few ways to do this, not sure which is best based on the specifics of yoru situation.&lt;/P&gt;

&lt;P&gt;1) Change the lookup table to include every IP address and its Area. So instead of 10.0.1.0/24, include 10.0.1.1, 10.0.1.2, 10.0.1.3, .... in the table.&lt;/P&gt;

&lt;P&gt;2) Break the IP address up into 4 sections, and then compare the third section with a lookup table to determine what area the IP is in. So "1"=A, "2"=B, ....&lt;/P&gt;

&lt;P&gt;3) Use "cidrmatch" in your search string to classify IPs instead of usign a lookup table at all.&lt;/P&gt;

&lt;P&gt;3) Use "cidrmatch" in your string to add an additional field to each event that has the range the IP is in as the value. So if the ip is 10.0.1.2, use cidrmatch to add a field/value pair cidr="10.0.1.0/24". Then do the lookup on the field cidr.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Dec 2011 16:18:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-in-range-value/m-p/40312#M9285</guid>
      <dc:creator>rtadams89</dc:creator>
      <dc:date>2011-12-09T16:18:59Z</dc:date>
    </item>
  </channel>
</rss>

