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
SplunkTrust
SplunkTrust

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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

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

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...