Maps - how to export

Hi, The Maps app in 6.7.1 is awesome, so much that it would be great to be able to export maps configuration and import into other clusters. How is this possible in the solution today? Where is the maps configuration stored?
Thanks for the great work :smile:

Hey @Babadofar, the Import/Export UI in Kibana in 6.7.1 only works with Visualizations, Saved Searches, Dashboards and Index Patterns. We're working on improving this situation here but until that work is done you can use the Saved Object APIs to get and create the map objects.

Thanks! Glad to know there is a solution. Can you give some more details? Is this a separate type?
I couldn't find anything using any of the suggested types: https://www.elastic.co/guide/en/kibana/6.7/saved-objects-api-get.html

The following curl will return all of the map saved objects:

curl http://localhost:5601/api/saved_objects/_find?type=map

Using the response of the find, you can then execute a GET for the specific map using the equivalent of:

curl http://localhost:5601/api/saved_objects/map/2c9c1f60-1909-11e9-919b-ffe5949a18d2
1 Like

Here's a tiny python 2.7 script for those in need . Once uploaded, insert the id into the appropriate part of the maps url to view your newly imported glory.

import requests
from_kibana ='https://kibana'
to_kibana = 'https://kibana2'
r = requests.get(from_kibana + '/api/saved_objects/_find?type=map')
js = r.json()
mapconfig = js['saved_objects'][0]['attributes']
mapout = {'attributes': mapconfig}
p = requests.post(to_kibana +'/api/saved_objects/map/vehicles' , 
	 json=mapout, headers={'kbn-xsrf':'true'} )
print(p)
print(p.json())
print('check that map was uploaded')
r = requests.get(to_kibana + '/api/saved_objects/_find?type=map')
print(r.text)
1 Like

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