The mapping equivalent of a Swiss Army knife for Splunk.
Publications: 1 - CRUZ, M. O.; MACEDO, H.; GUIMARãES, A. P. Grouping similar trajectories for carpooling purposes. In: Brazilian Conference on Intelligent Systems. [S.l.: s.n.], 2015. p. 234–239. ISBN 9781509000166.
Big thanks to the following people:
Maps+ for Splunk is compatible with Splunk 7.x
base_search | table latitude, longitude [ description | tooltip | title | icon | customIcon | customIconShadow | markerColor | markerPriority | markerSize | markerAnchor | popupAnchor | markerVisibility | iconColor | shadowAnchor | shadowSize | prefix | extraClasses | layerDescription | layerVisibility | layerIcon | layerIconSize | layerIconColor | layerIconPrefix | pathLayer | pathWeight | pathOpacity | pathColor | antPath | antPathDelay | antPathPulseColor | antPathPaused | antPathReverse | antPathDashArray | layerGroup | layerPriority | clusterGroup | heatmapInclude | heatmapLayer | heatmapPointIntensity | heatmapMinOpacity | heatmapRadius | heatmapBlur | heatmapColorGradient | circleStroke | circleRadius | circleColor | circleWeight | circleOpacity | circleFillColor | circleFillOpacity | feature | featureDescription | featureTooltip | featureColor | featureWeight | featureOpacity | featureStroke | featureFill | featureFillColor | featureFillOpacity | featureRadius | _time]
Latitude Coordinates
Longitude Coordinates
Desciption that is displayed in a pop-up when then marker is clicked on the map. You can get creative with this field. Combine a bunch of other fields or lookups using eval to make the description full of detail. This field supports HTML.
Maps+ allows you to dynamically style map markers and add icons via SPL. Create fields using eval to define colors for the marker or use an icon from Font Awesome Solid, Font Awesome Brands, ionicons or Bootstrap Glyphicons.
By default, markers are rendered as PNG's. The set of markers comes in a limited array of color values and cannot be re-sized. If you want access to an unlimited color palette and the ability to size markers, use SVG based markers.
Control the size of the icons using the extraClasses
field. See Font Awesome documentation for details on which classes to use.
If you own a Font Awesome Pro license, you can upload the remaining web fonts into $SPLUNK_HOME/etc/apps/leaflet_maps_app/appserver/static/visualizations/maps-plus/contrib/fonts
and then reference them using the appropriate prefix
values far
or fal
.
png
- Default
Icon mouse hover over description. Deprecated (with backwards compatibility) - see tooltip
Tooltip displayed on marker hover.
Icon displayed in map marker - Any icon from Font Awesome, ionicons or Bootstrap Glyphicons - Default circle
Color of map marker - red
, darkred
, lightred
, orange
, beige
, green
, darkgreen
, lightgreen
, blue
, darkblue
, lightblue
, purple
, darkpurple
, pink
, cadetblue
, white
, gray
, lightgray
, black
. - Default blue
Color of icon - Any CSS color name, Hex or RGB value. - Default white
.
fa
(Font Awesome), fab
(Font Awesome Brands), ion
(ionicons) or glyphicon
(Bootstrap Glyphicons) - Default fa
Any extra CSS classes you wish to add for styling. Here are some additional classes you can use with Font Awesome or Ionicons to change the styling. Default fa-lg
Dynamically size markers and assign any color (name or hex value). The following settings control SVG based markers.
svg
Comma separated string representing the pixel width and height of marker, respectively. - Default 35,45
Color of map marker. Use any common HTML color code name or hex value. - Default #38AADD
Comma separated string representing the coordinates of the "tip" of the icon (relative to its top left corner). - Default 15,50
Comma separated string representing the coordinates of the point from which popups will "open", relative to the icon anchor.
Comma separated string representing the pixel width and height of the marker shadow. You typically don't need to change this value unless you increase or decrese the markerSize. Set to 0,0
to disable shadows. - Default 30,46
Comma separated string representing the coordinates of the "tip" of the shadow (relative to its top left corner). You typically don't need to change this value unless you increase or decrese the markerSize. - Default 30,30
Color of icon - Any CSS color name, Hex or RGB value. Default white.
fa
(Font Awesome) or ion
(ionicons). Default fa
Any extra CSS classes you wish to add for styling. Here are some additional classes you can use with Font Awesome to change the styling.
Use circle markers when you have a lot of points to plot and you need performance. Circle markers are rendered using canvas instead of SVG which gives a huge performance boost. There are also a ton of customizaiton options through the available SPL fields.
circle
Radius of the circle marker, in pixels
Stroke color - Any CSS color name, Hex or RGB value. - Default white
Fill color - Any CSS color name, Hex or RGB value. - Default white
. Defaults to the value of the circleColor field
Stroke opacity
Fill opacity.
Whether to draw stroke along the path. Set it to false to disable borders.
Stroke width in pixels
Use any image as a map marker. Copy the image into $SPLUNK_HOME/etc/apps/leaflet_maps_app/appserver/static/visualizations/maps-plus/contrib/images
and set the customIcon
field to the name of the image. Use markerSize
to increase or decrease the size of the icon.
Set the markerType
field to icon
to only display the icon without a marker. Control the size of the icons using the extraClasses
field. See Font Awesome documentation for details on which classes to use. Control the color of the icon with iconColor
.
Render heatmaps with or without markers. Control heatmaps via the format menu or directly with SPL. Create multiple heatmap layers via SPL with the heatmapLayer
field. When controlling heatmaps through SPL, the first event for a given heatmapLayer
will define the heatmap settings heatmapMinOpacity
heatmapMaxZoom
heatmapRadius
heatmapBlur
heatmapColorGradient
, if specified, otherwise values specified in the format menu will be used.
Name of group for display using layer controls - Default heatmap
Include coordinates in heatmap layer - Default true
Control the intensity of the point - Default 1.0
The minimum opacity the heat will start at
Radius of each "point" of the heatmap - Default 25
Amount of blur - Default 15
Color gradient config - Default {"0.4":"blue","0.6":"cyan","0.7":"lime","0.8":"yellow","1":"red"})
Load features drawn with the measure tool on the map through SPL or lookup files.
Use the measure tool in the upper right corner to draw a point, line or polygon on the map. Upon completion, a Feature Defintion can be copied and used with the feature
field.
Adjust the look and behavior of the feature with the following fields.
Feature color - Any CSS color name, Hex or RGB value. - Default white
Desciption that is displayed in a pop-up when then marker is clicked on the map. You can get creative with this field. Combine a bunch of other fields or lookups using eval to make the description full of detail. This field supports HTML.
Tooltip displayed on feature hover.
Name of group for display using layer controls - Default feature
Stroke width in pixels - Default 3
Whether to draw stroke along the path. Set it to false
to disable borders on polygons or circles.
Whether to fill the path with color. Set it to false
to disable filling on polygons or circles.
Feature fill color - Any CSS color name, Hex or RGB value. - Default featureColor
Fill opacity - Default 0.2
Radius of circle in meters - Default 10
Define the features with the feature
field. Optionally, store the features in a lookup file and use | append [|inputlookup feature-lookup.csv]
to load the features on map
Example Search
| append [| makeresults | eval feature="42.25946306970395,-87.99049168825151;42.25916530072335,-87.99044072628021;42.259145449407995,-87.98961728811265;42.259472995312414,-87.98967629671098;42.25946306970395,-87.99049168825151", layerDescription="polygon layer", featureTooltip="polygon tooltip", featureDescription="polygon description", featureLayer="polygon layer", featureColor="#41dff4", featureFillColor="#55f441", featureFillOpacity="0.1"]
| append [| makeresults | eval feature="42.25895289132462,-87.99104690551759;42.25959408760995,-87.98937588930131", layerDescription="line layer", featureDescription="line description", featureTooltip="line tooltip", featureLayer="line layer", featureColor="#f441d3"]
| table feature, layerDescription, tooltip, featureDescription, featureTooltip, featureColor, featureStroke, featureWeight, featureRadius, featureLayer, featureFillColor, featureFillOpacity
If you have a dataset that contains multiple coordinates for each object (think cars, trains, planes, bicycles, anything that moves and can be tracked) you can trace the path on the map. Control whether markers are displayed along the path using the markerVisibility
setting. Show split intervals by enabling Path Splits
and adjusting the Path Split Interval
in the format menu options. Note that _time
must be present for split intervals to work.
Show marker for the given coordinates. Set to marker
to show marker or any other value to hide.
Name of group for display using layer controls - Default path
Weight (width) of path - Default 5
Opacity of path line - Default 0.5
The color of the path. If not specified, the color will be chosen randomly from the set of colors listed in the Path Colors option.
Use the following fields to add an ant path animation showing direction of travel.
Enable or disable Ant Path animation. Disabled by default. Set to true
to enable.
Animation delay in milliseconds - Default 1000
Color of dash - Default #FFFFFF
Pause animation - Default false
Reverse animation - Default false
Comma separated size of animated dashes - Default 10,20
Visualize direction along a path with a moveable marker. Enable playback on all paths under Format Menu -> Path Lines -> Playback. When playback is enabled, use the play or slider controls to replay the route for a path. Use the context menu to add all paths, clear or reset playback. Use the context menu by clicking on a path to add or remove it from playback. If time ranges for paths vary wildly there may be significant gaps (wait times) before the next marker(s) begin to play.
Use the following fields to control playback.
toggle playback for a path - Default false
Higher priority markers will render on top of lower priority markers. This is especially useful for dense maps where you need certain markers to stand out over others.
Use the following setting to set the marker priority.
Number used to set marker priority. Higher value numbers render over lower value numbers. Set a high value like 1000
(or a high negative value to render beneath). Default 0
Use in conjunction with layerGroup
for circle markers, pathLayer
for paths and heatmapLayer
for heatmaps to prioritize layer rendering. This is especially useful for dense maps where you need certain layers to stand out over others.
Warning: When using the canvas renderer in conjunction with layerPriority
, mouse events are affected for all layers below the highest priority layer. This is a bug in Leaflet. If you don't need to use tooltip
, description
or drilldown and want the performance boost canvas provides, this shouldn't be an issue.
Use the following setting to set the layer priority.
Number used to set layer priority when using Circle. Higher value numbers render over lower value numbers. Set a high value like 1000
(or a high negative value to render beneath). Default 0
The visualization will identify any non-standard fields and make them available as drilldown fields. Simply add any fields you wish to the final table command and you'll have access to them via drilldown in Simple XML.
Use the drilldown editor to set the action for the drilldown.
See the documentation on contextual drilldown. Refer to this section of the docs on accessing tokens for dynamic drilldown.
Note that $click.value$
does not get set through the Custom Visualization API. Use $row.fieldname$
to acceess a drilldown value.
When using the Click
drilldown mouse event, use the tooltip
field instead of the description
field to display information about the marker as you hover over the icon.
Drilldown is disabled by default. Enable it in the main Map section of the format menu. Simply double-click on a marker to activate the drilldown behavior.
Group marker/icon styles into their own layer. A layer control widget (enabled by default, but optionally hidden) is presented in the upper right hand corner that displays a legend for each icon class with a check-box to toggle visibility of the markers on the map. This control works for both clustered and stand-alone markers.
Specify groups with the layerGroup
field to filter markers via layer controls. The default behavior is to group by icon. If you have the same icon with different colors, the layerGroup
field allows you to split them into their own group for filtering.
Description that is added next to the icon in the layer control legend. this field supports HTML
Specify unique group that markers, including circle markers, belong to. Use heatmapLayer
and pathLayer
to group heatmap and path layers (repsectively) together
Icon displayed in layer control legend - Any icon from Font Awesome Solid, Font Awesome Brands, ionicons or Bootstrap Glyphicons - Default first icon detected for defined layerGroup
Size of icon, in pixels, displayed in the layer control legend, specified as height,width
Color of icon in layer control legend - Any CSS color name, Hex or RGB value. - Default white
Icon prefix - Default fa
Initial visibility of layer in layer control menu. Set to false
to hide from map. - Default true
By default, the visualization renders all markers into a single cluster group. Override this behavior using the clusterGroup
SPL field. Refer to the Multi-Cluster Groups
dashboard example in the app for details.
Add custom overlays to the map. The first release implements a KML or KMZ overlay feature. If you have existing KML/KMZ files that define features (polyline, polygons, whatever) you can now leverage them to overlay these features on the map.
Copy any KML or KMZ files into the following directory
$SPLUNK_HOME/etc/apps/leaflet_maps_app/appserver/static/visualizations/maps-plus/contrib/kml
Click Format
and selct the Overlays
tab. Enter a comma separated list of filenames that you uploaded to the above directory. File order dictates feature layering - e.g., file1.kml renders beneath file2.kml
file1.kml,file2.kmz
The files will be asynchronously loaded when the map is rendered.
The app has limited support for localizing portions of the app. Select the i18n
tab of the format menu to select your language. Current supported languages are English and Japanese. Reach out to me directly if you'd like to contribute translations for your language.
Interactively measure paths and area on the map. The feature is enabled by default. Hover over the icon in the upper right corner of the map and then select Create new measurement
. You can draw a simple path or click to define multiple points to measure an area. Measurements will not be persisted for future use. This is an interactive tool designed for a single session. See the features section for persisting features drawn by the measurement tool.
API keys for use with Google Places search, Bing Maps and the Google Streetview comapnion viz must be stored in Splunk's storage/passwords REST endpoint. Every user who needs access to a key must have the list_storage_passwords
capability enabled for their role. Set ACL's on credentials to narrow the scope of who can access them. Download and install my REST storage/passwords Manager for Splunk to make this process painless.
A search control for the Google Places API. Log into the Google API Console and enable the Google Places API Web Service
and Google Maps JavaScript API
for the given project and create an API key. See Google's docs for detailed instructions.
Enable the search control via the format menu option Google Places -> Google Places Search -> Enabled
Set the API Key User
option Google Places -> API Key User
If a realm is specified when creating the API Key User, use the optional API Key Realm
option Google Places -> API Key Realm
Optionally set the Zoom Level
option Google Places -> Zoom Level
for the desired fly to zoom level.
A Bing Maps tile layer.
Enable
or Disable
Bing Maps via the format menu option Bing Maps -> Bing Maps -> Enabled
. When Bing Maps are enabled, the default tile layer set and the map attribution override setting will not work.
Set the API Key User
option Bing Maps -> API Key User
If a realm is specified when creating the API Key User, use the optional API Key Realm
option Google Places -> API Key Realm
Choose the desired Tile Layer
under Bing Maps -> Tile Layer
Optionally set the Label Language
using Bing Maps -> Label Language
to localize the tile labels in the desired language. See Microsoft's documentation for more details.
Select one of six available map tiles
Use your own map tile URL and override defaults. Example: http://a.tiles.wmflabs.org/hikebike/{z}/{x}/{y}.png. Find more tiles here
Use your own attribution.
Use Canvas renderer for performance boost drawing vector layers (path, circle). Requires modern browser with Canvas support.
Display progress spinner for long running searches
Enable or disable scroll wheel zoom
Enable or disable full screen mode. Map takes up all available space in browser and adjust to resize.
Enable or disable drilldown - Requires browser Refresh
Select mouse event that triggers drilldown from markers
Enable or disable context menu when right clicking the map
Initial Height Of Map - Default 600
Dynamically set map view that contains all markers with the maximum zoom level possible when search finishes. - Default Enabled
Delay in milliseconds before triggering Auto Fit & Zoom. Increase if you get inconsistent behavior - Default 500
Delay in seconds before refreshing the dasbhoard. WARNING - Refresh forces a full browser refresh on the entire dashboard. This workaround addresses a usability issue in the Custom Viz API around reliably honoring panel or global SimpleXML refresh. (default: 0 - disabled)
Initial Zoom for map - Default 6
Initial Center Latitiude - Default 39.50
Initial Center Longitude - Default -98.35
Minimum zoom for tile layer. Does not affect map zoom. - Default 1
Maximum zoom for tile layer. Does not affect map zoom. - Default 19
Disable clustering and plot all markers. WARNING - This comes at a significant performance penalty for large datasets. - Requires browser Refresh
Display all popups on page load. Only works with clustering disabled. - Requires browser Refresh
Allow multiple popups to dispaly on screen without closing previous. Will disappear at higher zoom levels with clustering enabled. Enabled by default when showing all popups. - Requires browser Refresh
Animate cluster separation on zoom - Requires browser Refresh
Re-style single marker icon to marker cluster style (round) - Requires browser Refresh
At this zoom level and below, markers will not be clustered. Must set Disable Clustering At Zoom to Enabled.
At this zoom level and below, markers will not be clustered. Must set Disable Clustering At Zoom to Enabled.
A cluster will cover at most this many pixels from its center - Default 80
- Requires browser Refresh
Display an alert warning that the cluster exceeds threshold at max-zoom and do not show underlying markers. Browser may hang and die if a single point exceeds a very large number.- Default 100
- Requires browser refresh
Increase to increase the distance away that markers appear from the center when expanded at max zoom. - Default 1
- Requires browser refresh
Open the tooltip permanently or only on mouseover. Depends on tooltip field in search results.
Tooltip follows mouse instead of fixed position.
Enable or disable heatmap.
Only show the heatmap. No markers will be rendered.
Minimum opacity the heat will start at. - Default 1.0
Zoom level where the points reach maximum intensity. - Default Max Zoom of map
Max point intensity. - Default 1.0
Amount of blur. - Default 15
Color gradient config - Default {"0.4":"blue","0.6":"cyan","0.7":"lime","0.8":"yellow","1":"red"}
Draw path lines on map for markers that have multiple coordinates.
Use Canvas renderer for performance boost drawing paths. Requires modern browser with Canvas support
Field used to distinguish unique paths, e.g. vehicle number or trip ID
Comma-separated list of hex or html colors for path lines (wraps around if more paths than colors)
Split path into unique segments based on time span between points in path. Use this to setting to determine gaps within your path baed on then Path Split Interval. _time field must be present in results.
Time in seconds by which path segments are defined. Higher values result in a more continuous path. Lower values result in more segments and gaps within the path. - Default 60
Playback route along path line.
Show playback slider control.
Show playback date control.
Show playback play control.
Tick length in milliseconds. Increasing this value may improve performance at the cost of animation smoothness. - Default 50
Multiplier for default animation speed. - Default 100
Select language for localization
Enable or disable Google Places API search control.
Google Places API Key user stored in storage/passwords REST endpoint
Optional realm in storage/passwords REST endpoint associated with API key user.
Position of Google Places Search Bar - Default Top Left
Desired zoom level to fly to
Enable or disable Bing Maps tiles
Bing Maps API Key user stored in storage/passwords REST endpoint
Optional realm in storage/passwords REST endpoint associated with API key user
Select tile layer imagery set
Select language used for labels
Cluster color changes require browser refresh
#B5E28C
#6ECC39
Number at which cluster group two starts
#F1D357
#F0C20C
Number at which cluster group three starts
#FD9C73
#F18017
Layer control changes require browser refresh
Enable or disable dynamic filtering of layer groups on map. Each icon type's visibility can be toggled via control in upper right corner of map. - Default Enabled
Collapse or expand layer control widget. If collapsed, mousing over icon will expand. - Default Collapsed
Overlay control changes require browser refresh
Comma separated list of KML or KMZ file names copied into kml directory of app (file1.kml, file2.kml)
Enable or disable measurement plugin to allow path and area measurement on map. - Default Enabled
Language - Default English
Position of measurement icon on map - Default Top Right
Primary unit for length measurement - Default feet
Secondary unit for length measurement - Default miles
Primary unit for area measurement - Default acres
Secondary unit for area measurement - Default square miles
Color of measurement when actively drawing - Default #00ff00
Color of measurement when drawing is complete - Default #0066ff
Maps+ comes bundled with the new Google Street View visualization. Use this visualization as a drill-down target when clicking on a marker. See the Google Street View Drilldown
example dashboard in the app for detailed usage.
The Google Street View visualization requires an API key. Log in to the Google Cloud Console to enable the Maps JavaScript API
,Street View API
and generate an API key.
Comma separated coordinate pair the format <latitude>,<longitude>
. e.g - | eval coordinates=latitude.",".longitude
Google Street View API Key
Initial Height Of Map - Default 600
Enable or disable full screen mode. Map takes up all available space in browser and adjust to resize.