# Dashboard export with command line

**URL:** https://discuss.elastic.co/t/dashboard-export-with-command-line/184016
**Category:** Kibana
**Created:** [June 3, 2019, 3:34pm UTC](https://discuss.elastic.co/t/dashboard-export-with-command-line/184016 "2019-06-03T15:34:41Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Mouloud\_CHIKHOUNE](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mouloud_chikhoune/32/46957_2.png) [@Mouloud\_CHIKHOUNE](https://discuss.elastic.co/u/Mouloud_CHIKHOUNE)
#### Post date: [June 3, 2019, 3:34pm UTC](https://discuss.elastic.co/t/dashboard-export-with-command-line/184016/1 "2019-06-03T15:34:41Z")

</div>

`Hi, I would like to export **all** the dashboards of Kibana in a json file through a command line. I am using Kibana 7.`

---

<div class="post-metadata">

### Author: ![nickpeihl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nickpeihl/32/112622_2.png) [@nickpeihl](https://discuss.elastic.co/u/nickpeihl)
#### Post date: [June 3, 2019, 9:50pm UTC](https://discuss.elastic.co/t/dashboard-export-with-command-line/184016/2 "2019-06-03T21:50:33Z")

</div>

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.

1. Use the [Find Objects API](https://www.elastic.co/guide/en/kibana/current/saved-objects-api-find.html) to request a list of dashboards. _Note_ this may return multiple pages, requiring you to run this command multiple times specifying the `page` parameter.

Example:

```auto
curl -X GET "http://localhost:5601/api/saved_objects/_find?type=dashboard&fields=id" -H 'kbn-xsrf: true'

```

1. Use the [Bulk Get Objects API](https://www.elastic.co/guide/en/kibana/current/saved-objects-api-bulk-get.html) to request the dashboards using the `id` received in step 1.

Example:

```auto
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"
  }, ...
]
'

```

---

<div class="post-metadata">

### Author: ![Mouloud\_CHIKHOUNE](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mouloud_chikhoune/32/46957_2.png) [@Mouloud\_CHIKHOUNE](https://discuss.elastic.co/u/Mouloud_CHIKHOUNE)
#### Post date: [June 4, 2019, 7:40am UTC](https://discuss.elastic.co/t/dashboard-export-with-command-line/184016/3 "2019-06-04T07:40:42Z")

</div>

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](http://localhost:5601/api/kibana/dashboards/export?dashboard=dashboard_id)" \> /tmp/export.json. But instead of mentioning the dashboard id

---

<div class="post-metadata">

### Author: ![nickpeihl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nickpeihl/32/112622_2.png) [@nickpeihl](https://discuss.elastic.co/u/nickpeihl)
#### Post date: [June 4, 2019, 2:57pm UTC](https://discuss.elastic.co/t/dashboard-export-with-command-line/184016/4 "2019-06-04T14:57:55Z")

</div>

It is not possible to export all saved objects through the API. You need to pass the ids of the objects to export.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 2, 2019, 2:57pm UTC](https://discuss.elastic.co/t/dashboard-export-with-command-line/184016/5 "2019-07-02T14:57:58Z")

</div>

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