<?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: Specifying Field w/ iplocation in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Specifying-Field-w-iplocation/m-p/41820#M9686</link>
    <description>&lt;P&gt;Extending Iguinn's answer above:&lt;/P&gt;

&lt;P&gt;Change 2 lines of code of this file: &lt;CODE&gt;$SPLUNK_HOME/etc/apps/search/bin/iplocation.py&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  for r in results:
        #if "_raw" in r: # OLD
        if "PUT-THE-FIELDNAME-HERE" in r: # NEW
            #raw = r["_raw"] # OLD
            raw = r["PUT-THE-FIELDNAME-HERE"] # NEW
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 18 Apr 2012 01:08:52 GMT</pubDate>
    <dc:creator>boris</dc:creator>
    <dc:date>2012-04-18T01:08:52Z</dc:date>
    <item>
      <title>Specifying Field w/ iplocation</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Specifying-Field-w-iplocation/m-p/41818#M9684</link>
      <description>&lt;P&gt;I'm trying to parse data that has multiple IP addresses. It's my understanding that &lt;CODE&gt;iplocation&lt;/CODE&gt; tags any discovered IP with the relevant geolocation. My problem is that I'm unsure which IP address that that I'm getting results for. Is there a mechanism to specify the country of a given field such as ip1.Country or ip2.Country (assuming ip1 and ip2 are fields)?&lt;/P&gt;</description>
      <pubDate>Thu, 29 Dec 2011 00:03:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Specifying-Field-w-iplocation/m-p/41818#M9684</guid>
      <dc:creator>mwollenweber</dc:creator>
      <dc:date>2011-12-29T00:03:42Z</dc:date>
    </item>
    <item>
      <title>Re: Specifying Field w/ iplocation</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Specifying-Field-w-iplocation/m-p/41819#M9685</link>
      <description>&lt;P&gt;The iplocation command is  actually a Python script. So you could copy it and rename it to make your own customized version of the iplocation command. You will find the script at &lt;CODE&gt;$SPLUNK_HOME/etc/apps/search/bin/iplocation.py&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;You will find instructions in the Splunk Developer manual under &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/developer/searchscripts"&gt;Custom Search Commands&lt;/A&gt;.&lt;/P&gt;

&lt;P&gt;BTW, you could also change the iplocation command to use a different lookup technique; by default, iplocation does a lookup using &lt;CODE&gt;&lt;A href="http://api.hostip.info/get_html.php?ip=X" target="test_blank"&gt;http://api.hostip.info/get_html.php?ip=X&lt;/A&gt;&lt;/CODE&gt; where &lt;CODE&gt;X&lt;/CODE&gt; is the ip address.&lt;/P&gt;</description>
      <pubDate>Sun, 01 Jan 2012 05:50:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Specifying-Field-w-iplocation/m-p/41819#M9685</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2012-01-01T05:50:35Z</dc:date>
    </item>
    <item>
      <title>Re: Specifying Field w/ iplocation</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Specifying-Field-w-iplocation/m-p/41820#M9686</link>
      <description>&lt;P&gt;Extending Iguinn's answer above:&lt;/P&gt;

&lt;P&gt;Change 2 lines of code of this file: &lt;CODE&gt;$SPLUNK_HOME/etc/apps/search/bin/iplocation.py&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  for r in results:
        #if "_raw" in r: # OLD
        if "PUT-THE-FIELDNAME-HERE" in r: # NEW
            #raw = r["_raw"] # OLD
            raw = r["PUT-THE-FIELDNAME-HERE"] # NEW
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Apr 2012 01:08:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Specifying-Field-w-iplocation/m-p/41820#M9686</guid>
      <dc:creator>boris</dc:creator>
      <dc:date>2012-04-18T01:08:52Z</dc:date>
    </item>
  </channel>
</rss>

