Map your results
If you want to see your geo-tagged search results on a map, add a SplunkMap view and bind it to the search manager.
Add a map
Add the SplunkMap view like any other view. You can bind it to any search, but the view works best when your search includes geographic data. To indicate geographic coordinates, the search query must include latitude and longitude fields. The following map and table are bound to the same search manager:
{% splunkmap id="example-map" managerid="geosearch" tileSource="openStreetMap" %} {% table id="example-table" managerid="geosearch" count="5" %} {% searchmanager id="geosearch" search="| inputlookup earthquakes.csv | rename Lat as latitude Lon as longitude | geostats count" preview=True cache=True autostart=True %}The code to create these views is similar to what we've seen so far. We have a SplunkMap view and a Table view, both bound to the same search manager. Note the use of the geostats
search command and the latitude
and longitude
fields in the search query.
{% splunkmap id="example-map" managerid="geosearch" %} {% table id="example-table" managerid="geosearch" count="5" %} {% searchmanager id="geosearch" search="| inputlookup earthquakes.csv | rename Lat as latitude Lon as longitude | geostats count" preview=True cache=True autostart=True %}