<?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 Pulling data from a lookup file, what parameters need to be included and how do I format the data for a map visualization? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Pulling-data-from-a-lookup-file-what-parameters-need-to-be/m-p/173670#M49806</link>
    <description>&lt;P&gt;Some sample data for creating a maps visualisation in splunk&lt;/P&gt;

&lt;P&gt;countries_lat_long_int_code.csv&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;code,name,country,latitude,longitude
61,Australia,AU,-25.274398,133.775136
86,China,CN,35.86166,104.195397
49,Germany,DE,51.165691,10.451526
33,France,FR,46.227638,2.213749
64,New Zealand,NZ,-40.900557,174.885971
685,Samoa,WS,-13.759029,-172.104629
41,Switzerland,CH,46.818188,8.227512
1,United States,US,37.09024,-95.712891
678,Vanuatu,VU,-15.376706,166.959158
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If I add this to &lt;CODE&gt;Lookups » Lookup table files&lt;/CODE&gt; in Splunk, I can generate a map visualisation.&lt;/P&gt;

&lt;P&gt;Then if I put something like this in the search bar, it will generate a map visualization&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup countries_lat_long_int_code.csv | fields + latitude longitude | eval field1=100
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;the stats tab will look like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;latitude    longitude   field1
-25.274398  133.775136  100
35.86166    104.195397  100
51.165691   10.451526   100
46.227638   2.213749    100
-40.900557  174.885971  100
-13.759029  -172.104629 100
46.818188   8.227512    100
37.09024    -95.712891  100
-15.376706  166.959158  100
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What I would like to know is what parameters/format the data has to be in for a maps visualisation?&lt;BR /&gt;
For example, it looks like latitude and longitude must be the first 2 columns, and possibly in that particular order. &lt;/P&gt;

&lt;P&gt;Can anyone explain what other formats are accepted, or point me in the right direction? For example I am just playing around with something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup countries_lat_long_int_code.csv | fields + latitude longitude | eval field1=100 | eval field2=200 | eval field3="country name"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 29 Sep 2020 07:00:00 GMT</pubDate>
    <dc:creator>HattrickNZ</dc:creator>
    <dc:date>2020-09-29T07:00:00Z</dc:date>
    <item>
      <title>Pulling data from a lookup file, what parameters need to be included and how do I format the data for a map visualization?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Pulling-data-from-a-lookup-file-what-parameters-need-to-be/m-p/173670#M49806</link>
      <description>&lt;P&gt;Some sample data for creating a maps visualisation in splunk&lt;/P&gt;

&lt;P&gt;countries_lat_long_int_code.csv&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;code,name,country,latitude,longitude
61,Australia,AU,-25.274398,133.775136
86,China,CN,35.86166,104.195397
49,Germany,DE,51.165691,10.451526
33,France,FR,46.227638,2.213749
64,New Zealand,NZ,-40.900557,174.885971
685,Samoa,WS,-13.759029,-172.104629
41,Switzerland,CH,46.818188,8.227512
1,United States,US,37.09024,-95.712891
678,Vanuatu,VU,-15.376706,166.959158
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If I add this to &lt;CODE&gt;Lookups » Lookup table files&lt;/CODE&gt; in Splunk, I can generate a map visualisation.&lt;/P&gt;

&lt;P&gt;Then if I put something like this in the search bar, it will generate a map visualization&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup countries_lat_long_int_code.csv | fields + latitude longitude | eval field1=100
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;the stats tab will look like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;latitude    longitude   field1
-25.274398  133.775136  100
35.86166    104.195397  100
51.165691   10.451526   100
46.227638   2.213749    100
-40.900557  174.885971  100
-13.759029  -172.104629 100
46.818188   8.227512    100
37.09024    -95.712891  100
-15.376706  166.959158  100
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What I would like to know is what parameters/format the data has to be in for a maps visualisation?&lt;BR /&gt;
For example, it looks like latitude and longitude must be the first 2 columns, and possibly in that particular order. &lt;/P&gt;

&lt;P&gt;Can anyone explain what other formats are accepted, or point me in the right direction? For example I am just playing around with something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup countries_lat_long_int_code.csv | fields + latitude longitude | eval field1=100 | eval field2=200 | eval field3="country name"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 07:00:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Pulling-data-from-a-lookup-file-what-parameters-need-to-be/m-p/173670#M49806</guid>
      <dc:creator>HattrickNZ</dc:creator>
      <dc:date>2020-09-29T07:00:00Z</dc:date>
    </item>
    <item>
      <title>Re: Pulling data from a lookup file, what parameters need to be included and how do I format the data for a map visualization?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Pulling-data-from-a-lookup-file-what-parameters-need-to-be/m-p/173671#M49807</link>
      <description>&lt;P&gt;The data has to have the format you already have, i.e. degrees latitude and longitude - that's it. Where they come from and what else you do with them is entirely up to you.&lt;BR /&gt;
Have you had a look at the &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.5/SearchReference/Geostats"&gt;geostats command&lt;/A&gt;? It needs at least one statistics function to calculate numbers for the "geo-bins" (you can have a simple count of events per binned location, or an average of a field y, or anything you can think of). Of course it also needs latitude and longitude information. If these fields exist with the names &lt;CODE&gt;lat&lt;/CODE&gt; and &lt;CODE&gt;lon&lt;/CODE&gt;, then you won't have to explicitly specify them, otherwise you specifically tell the command where to look for those two values with &lt;CODE&gt;latfield =&lt;/CODE&gt; and &lt;CODE&gt;longfield =&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;To use your inputlookup, you can do something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup countries_lat_long_int_code.csv | geostats latfield=latitude longfield=longitude count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you named the colums in your csv "lat" and "lon", the search could simply be&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup countries_lat_long_int_code.csv | geostats count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I hope this answers your question. You don't need any order in your data, it's all in the fields. And heck, if it isn't, you can simply eval it on the fly &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Aug 2015 06:02:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Pulling-data-from-a-lookup-file-what-parameters-need-to-be/m-p/173671#M49807</guid>
      <dc:creator>jeffland</dc:creator>
      <dc:date>2015-08-14T06:02:50Z</dc:date>
    </item>
    <item>
      <title>Re: Pulling data from a lookup file, what parameters need to be included and how do I format the data for a map visualization?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Pulling-data-from-a-lookup-file-what-parameters-need-to-be/m-p/173672#M49808</link>
      <description>&lt;P&gt;tks, food for thought for me re the geostats. will look more into that. &lt;/P&gt;

&lt;P&gt;I tried this &lt;CODE&gt;| inputlookup countries_lat_long_int_code.csv | geostats latfield=latitude longfield=longitude count&lt;/CODE&gt; and this creates a &lt;CODE&gt;geo_bin&lt;/CODE&gt; column but not sure what this is, some other coordinates type method?&lt;/P&gt;</description>
      <pubDate>Mon, 17 Aug 2015 21:06:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Pulling-data-from-a-lookup-file-what-parameters-need-to-be/m-p/173672#M49808</guid>
      <dc:creator>HattrickNZ</dc:creator>
      <dc:date>2015-08-17T21:06:14Z</dc:date>
    </item>
    <item>
      <title>Re: Pulling data from a lookup file, what parameters need to be included and how do I format the data for a map visualization?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Pulling-data-from-a-lookup-file-what-parameters-need-to-be/m-p/173673#M49809</link>
      <description>&lt;P&gt;Yes, &lt;CODE&gt;geostats&lt;/CODE&gt; will group your events into buckets/bins (based on distance to each other on the map in relation to the current zoom level and the settings on the maximum number of bins), much like &lt;CODE&gt;bucket _time&lt;/CODE&gt; does based on time. It will do this for each zoom level and name the buckets with their x and y coordinates, which is why you see data like e.g. "zl_0" for zoom level 0 and "y_144_x_190" for the bucket containing all events from that area on that zoom level.&lt;BR /&gt;
The statistics view of &lt;CODE&gt;geostats&lt;/CODE&gt; is not that impressive though, head to the visualization tab to see the magic &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 07:01:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Pulling-data-from-a-lookup-file-what-parameters-need-to-be/m-p/173673#M49809</guid>
      <dc:creator>jeffland</dc:creator>
      <dc:date>2020-09-29T07:01:44Z</dc:date>
    </item>
    <item>
      <title>Re: Pulling data from a lookup file, what parameters need to be included and how do I format the data for a map visualization?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Pulling-data-from-a-lookup-file-what-parameters-need-to-be/m-p/173674#M49810</link>
      <description>&lt;P&gt;tks, just to clarify, does it do some kink of clustering i.e. looking at the uk and ireland you would only see one big marker and then as you zoom in this one marker would be broken up to show 2 markers 1 for ireland and one for UK. Do I understand that correctly?&lt;/P&gt;</description>
      <pubDate>Sun, 30 Aug 2015 21:28:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Pulling-data-from-a-lookup-file-what-parameters-need-to-be/m-p/173674#M49810</guid>
      <dc:creator>HattrickNZ</dc:creator>
      <dc:date>2015-08-30T21:28:21Z</dc:date>
    </item>
    <item>
      <title>Re: Pulling data from a lookup file, what parameters need to be included and how do I format the data for a map visualization?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Pulling-data-from-a-lookup-file-what-parameters-need-to-be/m-p/173675#M49811</link>
      <description>&lt;P&gt;Partially, yes. It creates these buckets based on distance, not based on country.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Aug 2015 09:10:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Pulling-data-from-a-lookup-file-what-parameters-need-to-be/m-p/173675#M49811</guid>
      <dc:creator>jeffland</dc:creator>
      <dc:date>2015-08-31T09:10:02Z</dc:date>
    </item>
  </channel>
</rss>

