# Export and import via curl kibana's dashboards and visualizations

**URL:** <https://discuss.elastic.co/t/export-and-import-via-curl-kibanas-dashboards-and-visualizations/41842>\
**Category:** Kibana\
**Created:** [February 16, 2016, 5:59am UTC](https://discuss.elastic.co/t/export-and-import-via-curl-kibanas-dashboards-and-visualizations/41842 "2016-02-16T05:59:56Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![LiorK](https://avatars.discourse-cdn.com/v4/letter/l/65b543/32.png) [@LiorK](https://discuss.elastic.co/u/LiorK)\
**Post date:** [February 16, 2016, 5:59am UTC](https://discuss.elastic.co/t/export-and-import-via-curl-kibanas-dashboards-and-visualizations/41842/1 "2016-02-16T05:59:56Z")

</div>

hi there,

I'm trying to get all the dashboards into json without the UI of the kibana itself (using curl).

at the moment , I succeed getting the dashboards but to open them on another instance I need to have the visualizations inside as well.  
My problem is to get the visualizations from kibana and export them to json via curl...  
how i can do it? ideas?

one more thing, using the Export Everything on the kibana didn't gave me any json file or anything at all.

Thanks

---

<div class="post-metadata">

**Author:** ![Rajeev\_Gaurav](https://avatars.discourse-cdn.com/v4/letter/r/3d9bf3/32.png) [@Rajeev\_Gaurav](https://discuss.elastic.co/u/Rajeev_Gaurav)\
**Post date:** [February 19, 2016, 8:40am UTC](https://discuss.elastic.co/t/export-and-import-via-curl-kibanas-dashboards-and-visualizations/41842/2 "2016-02-19T08:40:14Z")

</div>

Hi @LiorK,

I am also trying to import dashboard using kibana. Can you tell me how you succeeded as I am trying  
curl -XPUT [http://localhost:9200/.kibana/dashboard/testdashboard](http://localhost:9200/.kibana/dashboard/testdashboard) -d '{[  
{  
"\_id": "D1",  
"\_type": "dashboard",  
"\_source": {  
"title": "D1",  
"hits": 0,  
"description": "",  
"panelsJSON": "[{"id":"V1","type":"visualization","panelIndex":1,"size\_x":3,"size\_y":2,"col":1,"row":1}]",  
"optionsJSON": "{"darkTheme":false}",  
"uiStateJSON": "{}",  
"version": 1,  
"timeRestore": false,  
"kibanaSavedObjectMeta": {  
"searchSourceJSON": "{"filter":[{"query":{"query\_string":{"query":"\*","analyze\_wildcard":true}}}]}"  
}  
}  
}  
]}'  
and getting error as :  
% Total % Received % Xferd Average Speed Time Time Time Current  
Dload Upload Total Spent Left Speed  
100 1024 100 469 100 555 14656 17343 --:--:-- --:--:-- --:--:-- 17343{"error":{"root\_cause":[{"type":"mapper\_parsing\_exception","reason":"failed to parse"}],"type":"mapper\_parsing\_exception","reason":"failed to parse","caused\_by":{"type":"json\_parse\_exception","reason":"Unexpected character ('[' (code 91)): was expecting either valid name character (for unquoted name) or double-quote (for quoted) to start field name\n at [Source: org.elasticsearch.common.io.stream.InputStreamStreamInput@77224b66; line: 1, column: 3]"}},"status":400}

Kindly suggest some points.

---

<div class="post-metadata">

**Author:** ![pemontto](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pemontto/32/3908_2.png) [@pemontto](https://discuss.elastic.co/u/pemontto)\
**Post date:** [February 19, 2016, 7:10pm UTC](https://discuss.elastic.co/t/export-and-import-via-curl-kibanas-dashboards-and-visualizations/41842/3 "2016-02-19T19:10:10Z")

</div>

I use a Python script that pulls the dashboards I want from ES, enumerates the panels in the JSON of the dashboard, grabs those visualisations from ES and then looks for the index-patterns each of the visualisations uses and grabs those. Once I have all these documents I index them to the target index/ES host.

Right now I'm using an index template to avoid dynamic mapping issues (which I have seen), in the future I'll be pulling the mapping from the source index which will be more robust in supporting new Kibana features and plugins.

---

<div class="post-metadata">

**Author:** ![LiorK](https://avatars.discourse-cdn.com/v4/letter/l/65b543/32.png) [@LiorK](https://discuss.elastic.co/u/LiorK)\
**Post date:** [February 19, 2016, 7:33pm UTC](https://discuss.elastic.co/t/export-and-import-via-curl-kibanas-dashboards-and-visualizations/41842/4 "2016-02-19T19:33:57Z")

</div>

currectly i have script importing all the dashboards, visualisations and searches. and exporting to another .kibana index.

@Rajeev_Gaurav

- Note- gettin the dashboards alon will not help you if it has visualisations and also visualisations that uses searches. you will need those objects as well.
- your dashboard D1 hav visualisations inside? can you try to reach the following url [http://localhost:9200/.kibana/dashboard/D1/\_source](http://localhost:9200/.kibana/dashboard/D1/_source)

@pemontto can you please explain how dynamic mapping is related to this?

---

<div class="post-metadata">

**Author:** ![pemontto](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pemontto/32/3908_2.png) [@pemontto](https://discuss.elastic.co/u/pemontto)\
**Post date:** [February 19, 2016, 10:04pm UTC](https://discuss.elastic.co/t/export-and-import-via-curl-kibanas-dashboards-and-visualizations/41842/5 "2016-02-19T22:04:21Z")

</div>

Assuming you understand Elasticsearch dynamic mapping, an examples where this goes awry is where Kibana has a time field, specifically the "timeFrom " and "timeTo" in the dashboard document type. These fields can be a full ISO8601 date or relative like "now-3y".

If Elasticsearch first sees a document with an ISO8601 date the field will be dynamically set to a date field, now when you attempt to index that document with the "now-3y" you'll get a data type mismatch and it will fail to index all those dashboards.

So the solution is to either copy across the mapping from the source index, or use an index-template. Again I'd suggest updating the mapping from the source for future proofing.

---

<div class="post-metadata">

**Author:** ![Rajeev\_Gaurav](https://avatars.discourse-cdn.com/v4/letter/r/3d9bf3/32.png) [@Rajeev\_Gaurav](https://discuss.elastic.co/u/Rajeev_Gaurav)\
**Post date:** [February 23, 2016, 1:16pm UTC](https://discuss.elastic.co/t/export-and-import-via-curl-kibanas-dashboards-and-visualizations/41842/6 "2016-02-23T13:16:31Z")

</div>

I tried [https://github.com/elastic/beats-dashboards](https://github.com/elastic/beats-dashboards) but problem with this is that it does not support source meta data ("\_id") and thus It is not usable as i was using meta data for uniqueness of visualization and their mapping in [dashboard.So](http://dashboard.So) can suggestv points on that.

---

<div class="post-metadata">

**Author:** ![tbragin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tbragin/32/45166_2.png) [@tbragin](https://discuss.elastic.co/u/tbragin)\
**Post date:** [February 23, 2016, 2:08pm UTC](https://discuss.elastic.co/t/export-and-import-via-curl-kibanas-dashboards-and-visualizations/41842/7 "2016-02-23T14:08:42Z")

</div>

I would post this question in the Beats channel: [https://discuss.elastic.co/c/beats](https://discuss.elastic.co/c/beats)

---

<div class="post-metadata">

**Author:** ![shrikantgulia](https://avatars.discourse-cdn.com/v4/letter/s/c68b51/32.png) [@shrikantgulia](https://discuss.elastic.co/u/shrikantgulia)\
**Post date:** [June 28, 2017, 1:09pm UTC](https://discuss.elastic.co/t/export-and-import-via-curl-kibanas-dashboards-and-visualizations/41842/8 "2017-06-28T13:09:07Z")

</div>

How to export and import he pre configured dashboards Kibana ( 5.4.0)  
can pls anyone help me

---

<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:** [November 4, 2022, 4:14am UTC](https://discuss.elastic.co/t/export-and-import-via-curl-kibanas-dashboards-and-visualizations/41842/10 "2022-11-04T04:14:38Z")

</div>


