# Region Map (Not showing any data if USED vector map and joined field)

**URL:** https://discuss.elastic.co/t/region-map-not-showing-any-data-if-used-vector-map-and-joined-field/147005
**Category:** Kibana
**Created:** [September 3, 2018, 3:42am UTC](https://discuss.elastic.co/t/region-map-not-showing-any-data-if-used-vector-map-and-joined-field/147005 "2018-09-03T03:42:57Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![mark.quilates](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark.quilates/32/24802_2.png) [@mark.quilates](https://discuss.elastic.co/u/mark.quilates)
#### Post date: [September 3, 2018, 3:42am UTC](https://discuss.elastic.co/t/region-map-not-showing-any-data-if-used-vector-map-and-joined-field/147005/1 "2018-09-03T03:42:57Z")

</div>

Hi Guys,

Can help me solved my problem, I'm using ELK 6.2 and 6.3. I'm getting data once I filtered Region in China thru table but No data was showed if used region map.

Can help me how to solved this. Is there's any config should I need to do? Thanks

![image](https://us1.discourse-cdn.com/elastic/original/3X/b/3/b3e5f644a637b1137ba8a4d8e62bc0955152b5e3.png)  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/a/a/aac835924831b6420e2b18dda000af69a0cc4e80.png)

On KIbana 6.2 no data showed.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/1/8/1837126fe410031e41ebc1350f12c52d59e4b075.jpeg)

On Kibana6.3 getting these error

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/a/4/a4c5ed433e60b774997eaa1caa7d6db9a78295ca.png)

---

<div class="post-metadata">

### Author: ![thomasneirynck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thomasneirynck/32/23313_2.png) [@thomasneirynck](https://discuss.elastic.co/u/thomasneirynck)
#### Post date: [September 4, 2018, 1:22pm UTC](https://discuss.elastic.co/t/region-map-not-showing-any-data-if-used-vector-map-and-joined-field/147005/2 "2018-09-04T13:22:35Z")

</div>

hi @mark.quilates,

that error looks like a bug. In any case, it should not happen, although. Could you log this as an issue ([https://github.com/elastic/kibana/issues/new](https://github.com/elastic/kibana/issues/new)), with step-by-step instructions on how to reproduce?

As for the no-data, can you provide some sample data? How does your data-table look like? It's important that the join-field `China administrative division codes` exactly matches the field-values of that `geoip.region_code` field. I expect this is not the case. To see the field-values for all the layers, you can check [https://maps.elastic.co/#file/China%20Provinces](https://maps.elastic.co/#file/China%20Provinces).

---

<div class="post-metadata">

### Author: ![mark.quilates](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark.quilates/32/24802_2.png) [@mark.quilates](https://discuss.elastic.co/u/mark.quilates)
#### Post date: [September 5, 2018, 2:23am UTC](https://discuss.elastic.co/t/region-map-not-showing-any-data-if-used-vector-map-and-joined-field/147005/3 "2018-09-05T02:23:18Z")

</div>

Hi @thomasneirynck,

Already logged issue encountered: [Region Map (Not showing any data if used vector map and joined field) · Issue #22701 · elastic/kibana · GitHub](https://github.com/elastic/kibana/issues/22701)

> [@thomasneirynck](#):
>
> As for the no-data, can you provide some sample data? How does your data-table look like? It's important that the join-field `China administrative division codes` exactly matches the field-values of that `geoip.region_code` field. I expect this is not the case. To see the field-values for all the layers, you can check [Elastic Maps Service](https://maps.elastic.co/#file/China%20Provinces).

**If I used, China administrative division codes and geoip.region\_code:** I encountered the Fatal Error.

**While if I used, Province name (English) and geoip.region\_name:** The Guangxi Zhuang Autonomous Region, Ningxia Hui Autonomous Region and Inner Mongolia provinces had no data but, the rest of China regions were OK.

Since in my data, the name of the above regions are like these:

**Guangxi**  
**Ningsia Hui Autonomous Region**  
**Inner Mongolia Autonomous Region**

**Is there a way to rename the said regions?**

Below is the screenshot

 ![region_name](https://us1.discourse-cdn.com/elastic/original/3X/c/9/c982f4afcff3855cadc4063ab632eacca33df3a2.png)

---

<div class="post-metadata">

### Author: ![nickpeihl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nickpeihl/32/112622_2.png) [@nickpeihl](https://discuss.elastic.co/u/nickpeihl)
#### Post date: [September 5, 2018, 9:40pm UTC](https://discuss.elastic.co/t/region-map-not-showing-any-data-if-used-vector-map-and-joined-field/147005/4 "2018-09-05T21:40:32Z")

</div>

Hi @mark.quilates.

The best method for making the join is to [create a scripted field in Kibana](https://www.elastic.co/guide/en/kibana/current/scripted-fields.html) that concatenates the `geoip.country_code2` and `geoip.region_code fields`.

Here is the code for the scripted field.

```auto
if (doc['geoip.region_code.keyword'].value != null && doc['geoip.country_code2.keyword'].value != null) {
  return doc['geoip.country_code2.keyword'].value + '-' + doc['geoip.region_code.keyword'].value;
}
return "";

```

You may name the scripted field `geoip.region_iso_code`. Then you can create a Terms Aggregation on the `geoip.region_iso_code` field and select "ISO-3166-2 Identifier" as the Join Field in the Options tab.

The screenshots below show a region map created with Australia States.

You should also set a filter on the region map for `geoip.country_code2.keyword` is "CN" to limit the search to only China.

 ![region-map-data-tab](https://us1.discourse-cdn.com/elastic/original/3X/b/2/b2c132e6670650cb60e6be9e89d55b6f67d807ba.jpeg)

 ![region-map-options-tab](https://us1.discourse-cdn.com/elastic/original/3X/9/3/9373ce8dc1e9936ec381c391a5eafcf8187f3f3f.png)

I also recommend you download the latest version of the [MaxMind GeoIP 2 City database](https://dev.maxmind.com/geoip/geoip2/geolite2/) rather than the older one included with Logstash. You can [specify the file location of the downloaded database](https://www.elastic.co/guide/en/logstash/current/plugins-filters-geoip.html#plugins-filters-geoip-database) in your Logstash config. Let us know if you have questions.

Also, thank you for opening the [GitHub issue](https://github.com/elastic/kibana/issues/22701) for the 6.3 error. We will review the error and update the issue when we find out why that is happening.

---

<div class="post-metadata">

### Author: ![mark.quilates](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark.quilates/32/24802_2.png) [@mark.quilates](https://discuss.elastic.co/u/mark.quilates)
#### Post date: [September 6, 2018, 6:36am UTC](https://discuss.elastic.co/t/region-map-not-showing-any-data-if-used-vector-map-and-joined-field/147005/5 "2018-09-06T06:36:36Z")

</div>

@nickpeihl,

Thanks for your help. However, I still don't see any data on my dashboard.

Seems ISO name differ from my data.

![iso_region_code](https://us1.discourse-cdn.com/elastic/original/3X/2/4/24d245284fbe852cb44ae452fc24b2256c291c0f.png)

from the Region Map

![map](https://us1.discourse-cdn.com/elastic/original/3X/d/b/db760d60475851909b930fa8746355433f19edbd.png)

**Is there any way I can rename the below regions OR the ISO name?**

Guangxi Zhuang Autonomous Region,  
Ningxia Hui Autonomous Region and  
Inner Mongolia provinces

**Also, if can you try China Provinces from your end? If still working?  
Because Australia State, works on my end.  
But, China Provinces still not. Thanks!**

---

<div class="post-metadata">

### Author: ![nickpeihl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nickpeihl/32/112622_2.png) [@nickpeihl](https://discuss.elastic.co/u/nickpeihl)
#### Post date: [September 6, 2018, 4:51pm UTC](https://discuss.elastic.co/t/region-map-not-showing-any-data-if-used-vector-map-and-joined-field/147005/6 "2018-09-06T16:51:17Z")

</div>

Hi @mark.quilates,

China Provinces works for me when I [download and specify the latest MaxMind GeoLite2 database in Logstash](https://www.elastic.co/guide/en/logstash/current/plugins-filters-geoip.html#plugins-filters-geoip-database). It looks like you may be using an older version of the GeoLite2 City database. The version of the GeoLite2 databases that come with Logstash are older versions which does not have the latest region codes for China. So you might need to use the latest GeoLite2 City database with Logstash to re-ingest your data again.

Alternatively, it may be possible to use a Painless scripted field to rename your data to match the region name. This example uses the [Elvis operator](https://www.elastic.co/guide/en/elasticsearch/painless/current/painless-operators-reference.html#elvis-operator) to rename provinces if necessary. Then you may be able to use the new field to join to the English name.

```auto
doc['geoip.region_name.keyword'].value == 'Guangxi' ? 'Guangxi Zhuang Autonomous Region' : doc['geoip.region_name.keyword'].value == 'Ningsia Hui Autonomous Region' ? 'Ningxia Hui Autonomous Region' : doc['geoip.region_name.keyword'].value == 'Inner Mongolia Autonomous Region' ? 'Inner Mongolia' : doc['geoip.region_name.keyword'].value

```

Please note, province names may differ between versions of Logstash or GeoLite2 database. This is why I prefer to use the region codes.

You might also be interested in [this blog post](https://www.elastic.co/blog/new-country-subdivision-vectors-in-the-elastic-maps-service) that was published today.

---

<div class="post-metadata">

### Author: ![mark.quilates](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark.quilates/32/24802_2.png) [@mark.quilates](https://discuss.elastic.co/u/mark.quilates)
#### Post date: [September 7, 2018, 2:37am UTC](https://discuss.elastic.co/t/region-map-not-showing-any-data-if-used-vector-map-and-joined-field/147005/7 "2018-09-07T02:37:52Z")

</div>

Hi @nickpeihl and @thomasneirynck

Thank you guys for your time and patience, to help me to solved my issue I have encountered in my Kinaba dashboard (China provinces map).

**Its working and all good now. Thank you so much!**

 ![map](https://us1.discourse-cdn.com/elastic/original/3X/c/5/c594c6486752a42535239cbf19690af6d0bb88ef.png)

Cheers,

Mark

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [October 5, 2018, 3:47am UTC](https://discuss.elastic.co/t/region-map-not-showing-any-data-if-used-vector-map-and-joined-field/147005/9 "2018-10-05T03:47:11Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
