<?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 extracting latitude and longitude for countries from csv lookup in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/extracting-latitude-and-longitude-for-countries-from-csv-lookup/m-p/307963#M92413</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have a csv lookup with country names mentioned already. &lt;BR /&gt;
How can I extract &amp;amp; table the longitude and latitude for these countries in splunk ? &lt;/P&gt;

&lt;P&gt;I want o be able to ultimately use the geostats command.&lt;/P&gt;

&lt;P&gt;Thanks&lt;BR /&gt;
Aarti&lt;/P&gt;</description>
    <pubDate>Tue, 16 Jan 2018 18:44:57 GMT</pubDate>
    <dc:creator>aartivig289</dc:creator>
    <dc:date>2018-01-16T18:44:57Z</dc:date>
    <item>
      <title>extracting latitude and longitude for countries from csv lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/extracting-latitude-and-longitude-for-countries-from-csv-lookup/m-p/307963#M92413</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have a csv lookup with country names mentioned already. &lt;BR /&gt;
How can I extract &amp;amp; table the longitude and latitude for these countries in splunk ? &lt;/P&gt;

&lt;P&gt;I want o be able to ultimately use the geostats command.&lt;/P&gt;

&lt;P&gt;Thanks&lt;BR /&gt;
Aarti&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2018 18:44:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/extracting-latitude-and-longitude-for-countries-from-csv-lookup/m-p/307963#M92413</guid>
      <dc:creator>aartivig289</dc:creator>
      <dc:date>2018-01-16T18:44:57Z</dc:date>
    </item>
    <item>
      <title>Re: extracting latitude and longitude for countries from csv lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/extracting-latitude-and-longitude-for-countries-from-csv-lookup/m-p/307964#M92414</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;

&lt;P&gt;You can use the CSV as a source for longitude &amp;amp; latitude, then pass these values to the geostats command, example:&lt;/P&gt;

&lt;P&gt;index=[indexname] dest=[dest-ip-name] | lookup lookup.csv [CSV-IP] AS dest OUTPUT [CSV-LAT] as lat, [CSV-LONG] as long | geostats latfield=lat longfield=long count by dest&lt;/P&gt;

&lt;P&gt;Where &lt;BR /&gt;
[indexname] = Your index used&lt;BR /&gt;
[dest-ip-name] = Or whatever filter you want, used for the CSV lookup, in this example an IP address&lt;BR /&gt;
[CSV-IP] = The column name in CSV lookup for the IP address&lt;BR /&gt;
[CSV-LAT] = The column name in CSV lookup for the latitude value&lt;BR /&gt;
[CSV-LONG] = The column name in CSV lookup for the longitude value&lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2018 07:19:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/extracting-latitude-and-longitude-for-countries-from-csv-lookup/m-p/307964#M92414</guid>
      <dc:creator>veerh01</dc:creator>
      <dc:date>2018-02-02T07:19:54Z</dc:date>
    </item>
    <item>
      <title>Re: extracting latitude and longitude for countries from csv lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/extracting-latitude-and-longitude-for-countries-from-csv-lookup/m-p/307965#M92415</link>
      <description>&lt;P&gt;@aartivig289, you can get Country list with longitude and latitude from the following location: &lt;A href="https://developers.google.com/public-data/docs/canonical/countries_csv"&gt;https://developers.google.com/public-data/docs/canonical/countries_csv&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Following is a sample search where field in the index has &lt;CODE&gt;country&lt;/CODE&gt; and &lt;CODE&gt;geostats&lt;/CODE&gt; is to aggregate count by &lt;CODE&gt;clientip&lt;/CODE&gt; field:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;yourBaseSearch&amp;gt; country=*
| stats count by country clientip
| lookup countries country OUTPUT latitude longitude
| geostats latfield=latitude longfield=longitude sum(count) by clientip
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can also refer to Splunk Documentation: &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Geostats#Extended_examples"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Geostats#Extended_examples&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2018 15:31:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/extracting-latitude-and-longitude-for-countries-from-csv-lookup/m-p/307965#M92415</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-02-02T15:31:05Z</dc:date>
    </item>
  </channel>
</rss>

