{% load splunkmvc %} Splunk Application Framework Quick Start
Back Next

Splunk Application Framework Quick Start

Map your results

If you want to see your geo-tagged search results on a map, add a GoogleMap view and bind it to the search manager.

Add a map

Add the GoogleMap 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:

{% googlemap id="example-map" managerid="geosearch" %} {% resulttable id="example-table" managerid="geosearch" count="5" %} {% searchmanager id="geosearch" search="| inputlookup earthquakes.csv | rename Lat as lat Lon as lng | stats count by lat, lng" preview=True cache=True autostart=True %}

The code to create these views is similar to what we've seen so far. We have a GoogleMap view and a ResultTable view, both bound to the same search manager. Note lat and lng fields in the search query.

{% googlemap id="example-map" managerid="geosearch" %}

{% resulttable id="example-table" managerid="geosearch" count="5" %}

{% searchmanager id="geosearch" search="| inputlookup earthquakes.csv | rename Lat as lat Lon as lng | stats count by lat, lng" preview=True cache=True autostart=True %} 
Back Next
{% component_loader %}