I exported all the dashboard, visualisation, search and index I wanted into a json file and wath I want is to have a script that import this json file like the import button in the saved object area
Hey @TheSmartMonkey, the endpoints for importing/exporting saved objects aren't publicly supported or documented yet, so while it's possible to reverse engineer the way that Kibana uses the internal APIs, they could potentially change between different versions.
With that being said, are you looking to export a Dashboard and all of it's related Visualizations, Searches and Index Patterns? If so, there's an internal API to do this which we use for loading Beats Dashboards which can be used similar to the following:
Export Dashboard
curl -k -XGET 'http://localhost:5601/api/kibana/dashboards/export?dashboard=<put your dashboard ID here>' -u elastic:changeme > export.json
Thanks a lot for you help @Brandon_Kobel I share my script with the community hope that it will help some poeple
If my script can be better don't hesitate to comment
I export each of my dashboard 1 by 1 with this command :
curl -k -XGET 'http://localhost:5601/api/kibana/dashboards/export?dashboard=<put your dashboard ID here>' -u elastic:changeme > export.json
Then I did a python script to add all my dashboard, then to fix a default index pattern and finally to add index pattern that are not used in my dashboards
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.