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!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...

Updated Data Management and AWS GDI Inventory in Splunk Observability

We’re making some changes to Data Management and Infrastructure Inventory for AWS. The Data Management page, ...