Skip to content

Latest commit

 

History

History
178 lines (138 loc) · 5.71 KB

maps-getting-started.asciidoc

File metadata and controls

178 lines (138 loc) · 5.71 KB

Getting started with Maps

You work with Maps by adding layers. The data for a layer can come from sources such as {es} documents, vector sources, tile map services, web map services, and more. You can symbolize the data in different ways. For example, you might show which airports have the longest flight delays by using circles from small to big. Or, you might show the amount of web log traffic by shading countries from light to dark.

sample data web logs

Prerequisites

Before you start this tutorial, add the web logs sample data set. Each sample data set includes a map to go along with the data. Once you’ve added the data, open Maps and explore the different layers of the [Logs] Total Requests and Bytes map. You’ll re-create this map in this tutorial.

Take-away skills

In this tutorial, you’ll learn to:

  • Create a multi-layer map

  • Connect a layer to a data source

  • Use symbols, colors, and labels to style a layer

  • Create layers for {es} data

Creating a new map

The first thing to do is to create a new map.

  1. If you haven’t already, open Maps.

  2. On the maps list page, click Create map.

    A new map is created using a base tile layer.

    gs create new map

Adding a choropleth layer

Now that you have a map, you’ll want to add layers to it. The first layer you’ll add is a choropleth layer to shade world countries by web log traffic. Darker shades symbolize countries with more web log traffic, and lighter shades symbolize countries with less traffic.

Add a vector layer from the Elastic Maps Service source

  1. In the map legend, click Add layer.

  2. Click the Vector shapes data source.

  3. From the Layer dropdown menu, select World Countries.

  4. Click the Add layer button.

  5. Set Layer name to Total Requests by Country.

  6. Set Layer transparency to 0.5.

Join the vector layer with the sample web log index

You must add the web log traffic property to the world countries so that the property is available for styling. You’ll create a terms join to link the vector source World Countries to the {es} index kibana_sample_data_logs on the shared key iso2 = geo.src.

  1. Click plus gs plus icon to the right of Term Joins label.

  2. Click Join --select--

  3. Set Left field to ISO 3166-1 alpha-2 code.

  4. Set Right source to kibana_sample_data_logs.

  5. Set Right field to geo.src.

Set the vector style

The final step is to set the vector fill color to shade the countries by web log traffic.

  1. Click gs link icon to the right of Fill color.

  2. Select the grey color ramp.

  3. In the field select input, select count of kibana_sample_data_logs:geo.src.

  4. Click Save & close.

    Your map now looks like this:

    gs add cloropeth layer

Adding layers for {es} data

You’ll add two layers for {es} data. The first layer displays documents, and the second layer displays aggregated data. The raw documents appear when you zoom in the map to show smaller regions. The aggregated data appears when you zoom out the map to show larger amounts of the globe.

Add a vector layer from the document source

This layer displays web log documents as points. The layer is only visible when you 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 Min zoom to 9 and Max zoom to 24.

  7. Set Layer transparency to 1.

  8. Set Fill color to #2200ff.

  9. Click Save & close.

Add a vector layer from the grid aggregation source

Aggregations group {es} 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
  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 Min zoom to 0 and Max zoom to 9.

  7. Set Layer transparency to 1.

Configure the aggregation metrics
  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 vector style
  1. In Vector 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:

    gs add es layer

Saving the map

Now that your map is complete, you’ll want to save it so others can use it.

  1. In the application toolbar, click Save.

  2. Enter Tutorial web logs map for the title.

  3. Click Confirm Save.

You’re now ready to start creating maps using your own data. You might find these resources helpful: