Add a choropleth layeredit

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 to display world country boundariesedit

  1. Click Add layer.
  2. Select the EMS Boundaries layer.
  3. From the Layer dropdown menu, select World Countries.
  4. Click the Add layer button.
  5. Set Name to Total Requests by Country.
  6. Set Opacity to 50%.
  7. Click Add under Tooltip fields.
  8. In the popover, select ISO 3166-1 alpha-2 code and name and click Add.

Join the vector layer with the sample web log indexedit

You now have a vector layer containing the world countries. To symbolize countries by web traffic, you’ll need to augment the world country features with the count of Elasticsearch weblog documents originating from each country. To do this, you’ll create a term join to link the vector source World Countries to the Elasticsearch index kibana_sample_data_logs on the shared key iso2 = geo.src.

  1. Click plus gs plus icon next to the 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.
  6. Click and use metric count.
  7. Set Custom label to web logs count.

Set the layer styleedit

All of the world countries are still a single color because the layer is using static styling. To shade the world countries based on which country is sending the most requests, you’ll need to use data driven styling.

  1. Under Fill color, change the selected value from Solid to By value.
  2. In the field select input, select web logs count.
  3. Select the grey color ramp.
  4. Under Border color, change the selected color to white.
  5. Click Save & close.

    Your map now looks like this:

    gs add cloropeth layer