Adding layers for Elasticsearch data

edit

To 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

edit

This layer displays web log documents as points. The layer is only visible when users zoom in the map past zoom level 9.

  1. In the map legend, click Add layer.
  2. Click the Documents data source.
  3. Set Index pattern to kibana_sample_data_logs.
  4. Click the Add layer button.
  5. Set Layer name to Actual Requests.
  6. Set Zoom range for layer visibility to the range [9, 24].
  7. Set Layer transparency to 1.
  8. Set Fill color to #2200ff.
  9. Click Save & close.

    Your map now looks like this between zoom levels 9 and 24:

    gs add es document layer

Add a vector layer from the grid aggregation source

edit

Aggregations 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.

grid metrics both

Add the layer

edit
  1. In the map legend, click Add layer.
  2. Click the Grid aggregation data source.
  3. Set Index pattern to kibana_sample_data_logs.
  4. Click the Add layer button.
  5. Set Layer name to Total Requests and Bytes.
  6. Set Zoom range for layer visibility to the range [0, 9].
  7. Set Layer transparency to 1.

Configure the aggregation metrics

edit
  1. Click plus gs plus icon to the right of Metrics label.
  2. Select Sum in the aggregation select.
  3. Select bytes in the field select.

Set the layer style

edit
  1. In Layer style, change Symbol size:

    1. Set Min size to 1.
    2. Set Max size to 25.
    3. In the field select, select sum of bytes.
  2. Click Save & close button.

    Your map now looks like this between zoom levels 0 and 9:

    gs add es layer