Issue in exporting Dashboard and visualizations

Hi all...

can anyone help on this
how can we export a dashboard and its related visualizations at a time.
i appreciate the quick response.

Thanks in advance.

There's no way to do this automatically at the moment. Here's an open Github issue you can track: https://github.com/elastic/kibana/issues/8293

No way even in kibana-6 ?

Nope, sorry.

is there any possibility by exporting .kibana index with filter of dashboard and its viz's

could you please give a reply

The dashboard saved object document contains the IDs of all its linked visualizations. You can't do joins in ES so there's no way to grab everything in a single query, but you could easily write a script that retrieves everything for you directly from ES.

please suggest the script how to grab the dashboard with its related visualizations i mean how can i export the dashboard with its related visualizations
so that if i try to import on other elk instance my dashboard should be ready with its related visualizations and it should wait for the data to be indexed

Sorry, I don't have a pre-made script to do this job. All of Kibana's saved dashboards, visualizations, searches and index patterns are stored in the .kibana index in elasticsearch by default. You could grab one of the official Elasticsearch Clients for your favorite scripting language and write up a little script that grabs each dashboard and it's related objects (vis, index pattern, and any saved searches). Since ES exposes a REST API you could even do this with a simple shell script and cURL if that's your preference.

can you provide a curl command so that i can grab a sample dashboard with its related visualizations and saved searches from .kibana index

can anyone please provide the curl command so that i can grab a sample dashboard with its related visualizations and saved searches from .kibana index

There is a reasonably new Kibana API that does what you are looking for. It does not yet seem very well documented, but there are some examples in the GitHub issue that may be useful.

kibana api is not working in elastic 6...
Mr.Bargs provide a curl command so that i can export a my dashboard with its related visualizations and saved searches from .kibana index

It does work for Kibana 6.x. I have used it myself a few times.

please send the command which you used with kibana api

I used it like this:

curl -XGET http://localhost:5601/api/kibana/dashboards/export?dashboard=d25f3e20-041d-11e8-af22-05a1f7ea412f > dashboard_export.json

curl -XPOST http://localhost:5601/api/kibana/dashboards/import -H 'Content-Type: application/json' -H 'kbn-xsrf:true' -d @dashboard_export.json

As it is not a public, documented API, I suspect it may be subject to change, but for now it is working well for me...

Thank you if i have any queries will comeback to you

Christian_Dahlqvist
I need associated saved searches as well along with the visualizations

If you export a dashboard that includes a saved search or has a visualisation based on one, are they not also exported?

the dashboard i have exported is not having saved search included...that dashboard is build on index pattern.....it can get export index as well?