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!

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...