Issue in exporting Dashboard and visualizations


(Kabali12345) #1

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.


(Matt Bargar) #2

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


(Kabali12345) #3

No way even in kibana-6 ?


(Matt Bargar) #4

Nope, sorry.


(Kabali12345) #5

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


(Kabali12345) #6

could you please give a reply


(Matt Bargar) #7

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.


(Kabali12345) #8

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


(Matt Bargar) #9

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.


(Kabali12345) #10

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


(Kabali12345) #11

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


(Christian Dahlqvist) #12

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.


#13

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


(Christian Dahlqvist) #14

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


#15

please send the command which you used with kibana api


(Christian Dahlqvist) #16

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...


#17

Thank you if i have any queries will comeback to you


#18

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


(Christian Dahlqvist) #19

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


#20

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?