<?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 iplocation and counting ips in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/iplocation-and-counting-ips/m-p/68661#M17232</link>
    <description>&lt;P&gt;This is kind of a newbie question.&lt;/P&gt;

&lt;P&gt;I found the iplocation command and have had some success with it but. The searches seem a little slow. Is this due to the fact it's using the web for the City and Country lookup? Secondly, I'm trying to count the clientip field along with the iplocation.&lt;/P&gt;

&lt;P&gt;This works:&lt;/P&gt;

&lt;P&gt;sourcetype=access_combined | stats count by clientip | where count &amp;gt; 500&lt;/P&gt;

&lt;P&gt;This doesn't return the City:&lt;/P&gt;

&lt;P&gt;sourcetype=access_combined | stats count by clientip | where count &amp;gt; 500 | iplocation | table count, clientip, City&lt;/P&gt;

&lt;P&gt;This works, but I'd like to count the clientip:&lt;/P&gt;

&lt;P&gt;sourcetype=access_combined |dedup clientip | iplocation | table clientip, City, Country&lt;/P&gt;

&lt;P&gt;Thanks for the help.&lt;/P&gt;</description>
    <pubDate>Wed, 06 Jun 2012 14:19:21 GMT</pubDate>
    <dc:creator>khhenderson</dc:creator>
    <dc:date>2012-06-06T14:19:21Z</dc:date>
    <item>
      <title>iplocation and counting ips</title>
      <link>https://community.splunk.com/t5/Splunk-Search/iplocation-and-counting-ips/m-p/68661#M17232</link>
      <description>&lt;P&gt;This is kind of a newbie question.&lt;/P&gt;

&lt;P&gt;I found the iplocation command and have had some success with it but. The searches seem a little slow. Is this due to the fact it's using the web for the City and Country lookup? Secondly, I'm trying to count the clientip field along with the iplocation.&lt;/P&gt;

&lt;P&gt;This works:&lt;/P&gt;

&lt;P&gt;sourcetype=access_combined | stats count by clientip | where count &amp;gt; 500&lt;/P&gt;

&lt;P&gt;This doesn't return the City:&lt;/P&gt;

&lt;P&gt;sourcetype=access_combined | stats count by clientip | where count &amp;gt; 500 | iplocation | table count, clientip, City&lt;/P&gt;

&lt;P&gt;This works, but I'd like to count the clientip:&lt;/P&gt;

&lt;P&gt;sourcetype=access_combined |dedup clientip | iplocation | table clientip, City, Country&lt;/P&gt;

&lt;P&gt;Thanks for the help.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jun 2012 14:19:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/iplocation-and-counting-ips/m-p/68661#M17232</guid>
      <dc:creator>khhenderson</dc:creator>
      <dc:date>2012-06-06T14:19:21Z</dc:date>
    </item>
    <item>
      <title>Re: iplocation and counting ips</title>
      <link>https://community.splunk.com/t5/Splunk-Search/iplocation-and-counting-ips/m-p/68662#M17233</link>
      <description>&lt;P&gt;Yes, it is slow because it running over the web. This will work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=access_combined | iplocation | stats count, first(City) as City, first(Country) as Country by clientip
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Ideally, this will work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=access_combined  | stats count by clientip | iplocation
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But it doesn't because the iplocation commmand is rather poorly implemented and requires the ip address to simply exist somewhere in the raw text of the data, rather than being able to specify a field (it wouldn't be terribly hard to modify the code for it though in /opt/splunk/etc/apps/search/bin/iplocation.py). If it did though, it would be faster because it should have fewer lookups to perform.&lt;/P&gt;

&lt;P&gt;You may want to look at the ammap and google maps apps in Splunkbase instead.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://splunk-base.splunk.com/apps/22282/geo-location-lookup-script-powered-by-maxmind"&gt;http://splunk-base.splunk.com/apps/22282/geo-location-lookup-script-powered-by-maxmind&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jun 2012 15:09:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/iplocation-and-counting-ips/m-p/68662#M17233</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2012-06-06T15:09:13Z</dc:date>
    </item>
  </channel>
</rss>

