Hi, I would like to export **all** the dashboards of Kibana in a json file through a command line. I am using Kibana 7.
The easiest way to do this is from the Management - Saved Objects page within Kibana. But you are asking how to do this via command line which requires multiple steps.
- Use the Find Objects API to request a list of dashboards. Note this may return multiple pages, requiring you to run this command multiple times specifying the
pageparameter.
Example:
curl -X GET "http://localhost:5601/api/saved_objects/_find?type=dashboard&fields=id" -H 'kbn-xsrf: true'
- Use the Bulk Get Objects API to request the dashboards using the
idreceived in step 1.
Example:
curl -X POST "http://localhost:5601/api/saved_objects/_bulk_get" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d'
[
{
"type": "dashboard",
"id": "722b74f0-b882-11e8-a6d9-e546fe2bba5f"
},
{
"type": "dashboard",
"id": "47f2c680-a6e3-11e8-94b4-c30c0228351b"
}, ...
]
'
Thank you for your response. But I want to export all the dashboards and Visualizations in a json file through a single command line and without mentioning the ids.
Like in the command line curl: curl -X GET "http://localhost:5601/api/kibana/dashboards/export?dashboard=dashboard_id" > /tmp/export.json. But instead of mentioning the dashboard id
It is not possible to export all saved objects through the API. You need to pass the ids of the objects to export.