Adding layers for Elasticsearch data
editAdding layers for Elasticsearch data
editTo avoid overwhelming the user with too much data at once, you’ll add two layers for Elasticsearch data.
- The first layer will display individual documents. The layer will appear when the user zooms in the map to show smaller regions.
- The second layer will show aggregated data that represents many documents. The layer will appear when the user zooms out the map to show larger amounts of the globe.
Add a vector layer from the document source
editThis layer displays web log documents as points. The layer is only visible when users zoom in the map past zoom level 9.
- In the map legend, click Add layer.
- Click the Documents data source.
- Set Index pattern to kibana_sample_data_logs.
- Click the Add layer button.
-
Set Layer name to
Actual Requests
. - Set Zoom range for layer visibility to the range [9, 24].
- Set Layer transparency to 1.
- Set Fill color to #2200ff.
-
Click Save & close.
Your map now looks like this between zoom levels 9 and 24:
Add a vector layer from the grid aggregation source
editAggregations group Elasticsearch documents into grids. You can calculate metrics for each gridded cell.
You’ll create a layer for aggregated data and make it visible only when the map is zoomed out past zoom level 9. Darker colors will symbolize grids with more web log traffic, and lighter colors will symbolize grids with less traffic. Larger circles will symbolize grids with more total bytes transferred, and smaller circles will symbolize grids with less bytes transferred.
Add the layer
edit- In the map legend, click Add layer.
- Click the Grid aggregation data source.
- Set Index pattern to kibana_sample_data_logs.
- Click the Add layer button.
-
Set Layer name to
Total Requests and Bytes
. - Set Zoom range for layer visibility to the range [0, 9].
- Set Layer transparency to 1.
Configure the aggregation metrics
edit- Click plus to the right of Metrics label.
- Select Sum in the aggregation select.
- Select bytes in the field select.
Set the layer style
edit-
In Layer style, change Symbol size:
- Set Min size to 1.
- Set Max size to 25.
- In the field select, select sum of bytes.
-
Click Save & close button.
Your map now looks like this between zoom levels 0 and 9: