<?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 Trying to map IP address from lookup table in search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Trying-to-map-IP-address-from-lookup-table-in-search/m-p/481031#M134790</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I am trying to map the ip address in my search to my lookup table, and it should return me the countries of the IP address.&lt;/P&gt;

&lt;P&gt;Sample lookup table &lt;/P&gt;

&lt;P&gt;country     ip_address&lt;BR /&gt;
Italy           2.123.123.9/24, 2.124.124.9/11&lt;/P&gt;

&lt;P&gt;Problem is, in my events, my IP address is 2.123.123.1.&lt;/P&gt;

&lt;P&gt;I want to search the ip_address in the lookup table perhaps for 2.123.123 and return me Italy ?&lt;/P&gt;

&lt;P&gt;This is my search query &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=ip_address "status=200" ip_address
| lookup ip_mapping.csv ip_address outputnew u_country as country
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The search executed successfully, but there is no country being returned. What am i missing ? &lt;/P&gt;</description>
    <pubDate>Thu, 09 Jan 2020 11:00:35 GMT</pubDate>
    <dc:creator>wailoont</dc:creator>
    <dc:date>2020-01-09T11:00:35Z</dc:date>
    <item>
      <title>Trying to map IP address from lookup table in search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Trying-to-map-IP-address-from-lookup-table-in-search/m-p/481031#M134790</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I am trying to map the ip address in my search to my lookup table, and it should return me the countries of the IP address.&lt;/P&gt;

&lt;P&gt;Sample lookup table &lt;/P&gt;

&lt;P&gt;country     ip_address&lt;BR /&gt;
Italy           2.123.123.9/24, 2.124.124.9/11&lt;/P&gt;

&lt;P&gt;Problem is, in my events, my IP address is 2.123.123.1.&lt;/P&gt;

&lt;P&gt;I want to search the ip_address in the lookup table perhaps for 2.123.123 and return me Italy ?&lt;/P&gt;

&lt;P&gt;This is my search query &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=ip_address "status=200" ip_address
| lookup ip_mapping.csv ip_address outputnew u_country as country
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The search executed successfully, but there is no country being returned. What am i missing ? &lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2020 11:00:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Trying-to-map-IP-address-from-lookup-table-in-search/m-p/481031#M134790</guid>
      <dc:creator>wailoont</dc:creator>
      <dc:date>2020-01-09T11:00:35Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to map IP address from lookup table in search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Trying-to-map-IP-address-from-lookup-table-in-search/m-p/481032#M134791</link>
      <description>&lt;P&gt;assuming your lookup has field name as &lt;CODE&gt;country&lt;/CODE&gt; and &lt;CODE&gt;ip_address&lt;/CODE&gt;then  try below search-&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=ip_address "status=200" ip_address
 | lookup ip_mapping.csv ip_address OUTPUT  country as Country
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;After OUTPUT  you need to specify lookup fieldname&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2020 11:05:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Trying-to-map-IP-address-from-lookup-table-in-search/m-p/481032#M134791</guid>
      <dc:creator>493669</dc:creator>
      <dc:date>2020-01-09T11:05:55Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to map IP address from lookup table in search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Trying-to-map-IP-address-from-lookup-table-in-search/m-p/481033#M134792</link>
      <description>&lt;P&gt;&lt;A href="http://grumblesoft.com/2019/02/07/splunk-lookups-with-cidr-matching/"&gt;splunk-lookups-with-cidr-matching&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Is the setting OK?&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2020 11:32:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Trying-to-map-IP-address-from-lookup-table-in-search/m-p/481033#M134792</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-01-09T11:32:41Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to map IP address from lookup table in search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Trying-to-map-IP-address-from-lookup-table-in-search/m-p/481034#M134793</link>
      <description>&lt;P&gt;You need to do several things.&lt;BR /&gt;
1. configure a lookup definition which cidrmatching&lt;BR /&gt;
2. reference the lookup definition name in the lookup command NOT the filename.csv. When you reference the file directly you bypass the lookup definition features and break your cidrmatching&lt;/P&gt;

&lt;P&gt;Optional&lt;BR /&gt;
1. Why are you using a custom table instead of updating the geolocation database and using the iplocation command?&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;A href="https://github.com/georgestarcher/TA-geoip"&gt;https://github.com/georgestarcher/TA-geoip&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.1/SearchReference/Iplocation"&gt;https://docs.splunk.com/Documentation/Splunk/8.0.1/SearchReference/Iplocation&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.1/SearchReference/Iplocation"&gt;https://docs.splunk.com/Documentation/Splunk/8.0.1/SearchReference/Iplocation&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2020 21:49:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Trying-to-map-IP-address-from-lookup-table-in-search/m-p/481034#M134793</guid>
      <dc:creator>starcher</dc:creator>
      <dc:date>2020-01-09T21:49:39Z</dc:date>
    </item>
  </channel>
</rss>

