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 Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...