Renaming Countries on a Map

Hello,

I am using Kibana 5 and created a Region Map (based upon Open Street Map). Now I ran into the following problem: The countries' names on the map and in my data don't always match. For example, in my data, "Russia" is referred to as "Russian Federation". The map doesn't recognize the name and therefore doesn't display any results for this country.

It's impossible for me to change the names in my data as I am getting it from a different institute. Can I somehow change the names on the map or tell the programme that "Russian Federation" means "Russia"?

I hope, you understand what I mean.. :sweat_smile:

EDIT:

I just opened the [/usr/share/kibana/node_modules/caniuse-db/region-usage-json/RU.json] file - it also says "Russian Federation" there. I am confused - why doesn't the map display any results then?

Thank you in advance!

i don't think that file has anything to do with the region map ....
the region map vector files are hosted at elastic, so you won't be able to change them.
but you could always update your data to show relevant country names, or even define a script to do it on the fly.

to do it with a script, go to management, index patterns, select your index pattern, go to scripted fields and add a new one.

then something like

if (doc['country'].value == 'Russian Federation') return 'Russia';
return doc['country'].value;

should do the trick .... however this is taking much more resource intensive as would it be if your indexed data would have the right values.

you could also provide your own vector file with countries named as you like.

1 Like

@ppisljar Isn't there a mapping file on Kibana? It would be really helpful if I could change the country names there.

hi @Helix

scripted fields are an option like @ppisljar suggested. That's where you would define your mapping.

Another option is to host your own version of the map file. Then you can modify the individual country names in the geojson file itself. For instructions, you can check the doc:

https://www.elastic.co/guide/en/kibana/current/_configuration_2.html
https://www.elastic.co/guide/en/kibana/current/settings.html#regionmap-settings

1 Like

Thank you both so much, you really helped me!

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