All Apps and Add-ons

How to map results in Google maps in simple xml without using the geostats function

anssntaco
Path Finder

From the docs on the map element: Provides for mapping geographic coordinates as interactive markers on a world map. This visualization depends on results from the geostats search command.

Is the geostats function truly required in order to support mapping results? If not, what fields are required? what's their format? etc,... For example, other question mention needing a _geo field (format: eval _geo=lat.",".lon). What other fields are needed (and in what format do they need to be)?

0 Karma

somesoni2
Revered Legend

The <map> element requires field "latitude" and "longitude" field with other numeric field that you want to plot. The order of the field is crucial (it has to be latutude, longitude, <>). Here is a run anywhere example.

<form>
  <label>Geo Map</label>      
  <row grouping="2">
  <map>
  <title>Roma</title>
  <searchString>
    |stats count 
    |eval latitude=-8.70778 | eval longitude=-57.82654 | eval SomeNumberField=5 
    | append [|stats count 
    |eval latitude=-10.70778 | eval longitude=-47.82654 | eval  SomeTextField=99]
    | table  latitude, longitude, SomeNumberField,SomeTextField
  </searchString>
  <option name="mapping.data.maxClusters">500</option>
  <option name="mapping.markerLayer.markerMaxSize">20</option>  
  <option name="mapping.seriesColors">[0x0060DD]</option>
  <option name="mapping.map.zoom">2</option>
</map>
    <table>
      <searchString>
    |stats count 
    |eval latitude=-8.70778 | eval longitude=-57.82654 | eval SomeNumberField=5 
    | append [|stats count 
    |eval latitude=-10.70778 | eval longitude=-47.82654 | eval  SomeTextField=23]
    | table  latitude, longitude, SomeNumberField,SomeTextField
  </searchString>
    </table>    
  </row>
</form>
Get Updates on the Splunk Community!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...