# How to put a new dashboard in ElasticSearch from a dashbaord json file

**URL:** <https://discuss.elastic.co/t/how-to-put-a-new-dashboard-in-elasticsearch-from-a-dashbaord-json-file/45881>\
**Category:** Elasticsearch\
**Created:** [March 31, 2016, 7:29am UTC](https://discuss.elastic.co/t/how-to-put-a-new-dashboard-in-elasticsearch-from-a-dashbaord-json-file/45881 "2016-03-31T07:29:17Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Diyal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/diyal/32/10110_2.png) [@Diyal](https://discuss.elastic.co/u/Diyal)\
**Post date:** [March 31, 2016, 7:29am UTC](https://discuss.elastic.co/t/how-to-put-a-new-dashboard-in-elasticsearch-from-a-dashbaord-json-file/45881/1 "2016-03-31T07:29:17Z")

</div>

Hi,

I'm trying a curl method to import dashbaord to ES like this :

curl -s -XPOST localhost:9200/.kibana/\_bulk --data @Dashboard55.json

but not working:

{"error":{"root\_cause":[{"type":"parse\_exception","reason":"Failed to derive xcontent"}],"type":"parse\_exception","reason":"Failed to derive xcontent"}

My json file seems me correct, so did you have an idea ?

Thanks

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [March 31, 2016, 7:34am UTC](https://discuss.elastic.co/t/how-to-put-a-new-dashboard-in-elasticsearch-from-a-dashbaord-json-file/45881/2 "2016-03-31T07:34:12Z")

</div>

Perhaps it would be easier for us to help if we had the JSON file you're trying to post.

---

<div class="post-metadata">

**Author:** ![Diyal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/diyal/32/10110_2.png) [@Diyal](https://discuss.elastic.co/u/Diyal)\
**Post date:** [March 31, 2016, 7:42am UTC](https://discuss.elastic.co/t/how-to-put-a-new-dashboard-in-elasticsearch-from-a-dashbaord-json-file/45881/3 "2016-03-31T07:42:25Z")

</div>

Yes, Sorry

[  
{  
"\_id":"Dashboard55",  
"\_type": "dashboard",  
"\_source": {  
"title": "DashBoard\_Customer\_55",  
"hits": 0,  
"description": "",  
"panelsJSON": "[{"col":1,"id":"Visualization2","panelIndex":1,"row":1,"size\_x":3,"size\_y":2,"type":"visualization"},{"col":4,"id":"Visualization1","panelIndex":2,"row":1,"size\_x":2,"size\_y":2,"type":"visualization"},{"col":1,"id":"table1","panelIndex":3,"row":3,"size\_x":8,"size\_y":2,"type":"visualization"},{"col":6,"id":"Customer\_id\_Visu","panelIndex":4,"row":1,"size\_x":3,"size\_y":2,"type":"visualization"}]",  
"optionsJSON": "{"darkTheme":false}",  
"uiStateJSON": "{"P-1":{"spy":{"mode":{"fill":false,"name":null}}},"P-2":{"spy":{"mode":{"fill":false,"name":null}}}}",  
"version": 1,  
"timeRestore": false,  
"kibanaSavedObjectMeta": {  
"searchSourceJSON": "{"filter":[{"query":{"query\_string":{"query":"customer\_id:55","analyze\_wildcard":true}}}]}"  
}  
}  
}  
]

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [March 31, 2016, 7:45am UTC](https://discuss.elastic.co/t/how-to-put-a-new-dashboard-in-elasticsearch-from-a-dashbaord-json-file/45881/4 "2016-03-31T07:45:59Z")

</div>

That file doesn't conform to the spec of the [bulk API](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html). Why use the bulk API to add a single document?

---

<div class="post-metadata">

**Author:** ![Diyal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/diyal/32/10110_2.png) [@Diyal](https://discuss.elastic.co/u/Diyal)\
**Post date:** [March 31, 2016, 7:52am UTC](https://discuss.elastic.co/t/how-to-put-a-new-dashboard-in-elasticsearch-from-a-dashbaord-json-file/45881/5 "2016-03-31T07:52:24Z")

</div>

Ok,

I used this just to see how it work because i tried few methods without success.  
So are there curl methods to put just one document ?

Thanks

---

<div class="post-metadata">

**Author:** ![Diyal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/diyal/32/10110_2.png) [@Diyal](https://discuss.elastic.co/u/Diyal)\
**Post date:** [March 31, 2016, 7:58am UTC](https://discuss.elastic.co/t/how-to-put-a-new-dashboard-in-elasticsearch-from-a-dashbaord-json-file/45881/6 "2016-03-31T07:58:43Z")

</div>

With this method i have an other issue :

curl -XPOST '[http://localhost:9200/.kibana/dashboard/Dashboard55](http://localhost:9200/.kibana/dashboard/Dashboard55)' -d @Dashboard55.json

{"error":{"root\_cause":[{"type":"mapper\_parsing\_exception","reason":"failed to parse"}],"type":"mapper\_parsing\_exception","reason":"failed to parse","caused\_by": **{"type":"not\_x\_content\_exception","reason":"Compressor detection can only be called on some xcontent bytes or compressed xcontent bytes"}},"status":400}**

---

<div class="post-metadata">

**Author:** ![Diyal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/diyal/32/10110_2.png) [@Diyal](https://discuss.elastic.co/u/Diyal)\
**Post date:** [March 31, 2016, 8:29am UTC](https://discuss.elastic.co/t/how-to-put-a-new-dashboard-in-elasticsearch-from-a-dashbaord-json-file/45881/7 "2016-03-31T08:29:42Z")

</div>

Now It work, We must to delete a few first fields to have just this part:

{  
"title": "DashBoard\_Customer\_55",  
"hits": 0,  
"description": "",  
"panelsJSON": "[{"col":1,"id":"Visualization2","panelIndex":1,"row":1,"size\_x":3,"size\_y":2,"type":"visualization"},{"col":4,"id":"Visualization1","panelIndex":2,"row":1,"size\_x":2,"size\_y":2,"type":"visualization"},{"col":1,"id":"table1","panelIndex":3,"row":3,"size\_x":8,"size\_y":2,"type":"visualization"},{"col":6,"id":"Customer\_id\_Visu","panelIndex":4,"row":1,"size\_x":3,"size\_y":2,"type":"visualization"}]",  
"optionsJSON": "{"darkTheme":false}",  
"uiStateJSON": "{"P-1":{"spy":{"mode":{"fill":false,"name":null}}},"P-2":{"spy":{"mode":{"fill":false,"name":null}}}}",  
"version": 1,  
"timeRestore": false,  
"kibanaSavedObjectMeta": {  
"searchSourceJSON": "{"filter":[{"query":{"query\_string":{"query":"customer\_id:55","analyze\_wildcard":true}}}]}"  
}  
}

curl -XPUT [http://localhost:9200/.kibana/dashboard/Dashboard55/](http://localhost:9200/.kibana/dashboard/Dashboard55/) -d @Dashboard55.json

Thanks

---

<div class="post-metadata">

**Author:** ![klbrunnett](https://avatars.discourse-cdn.com/v4/letter/k/ecb155/32.png) [@klbrunnett](https://discuss.elastic.co/u/klbrunnett)\
**Post date:** [September 9, 2016, 3:32pm UTC](https://discuss.elastic.co/t/how-to-put-a-new-dashboard-in-elasticsearch-from-a-dashbaord-json-file/45881/8 "2016-09-09T15:32:32Z")

</div>

Is there any performance drawback to always using the bulk API instead of the single index operation?

---

<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 5, 2017, 10:21pm UTC](https://discuss.elastic.co/t/how-to-put-a-new-dashboard-in-elasticsearch-from-a-dashbaord-json-file/45881/9 "2017-07-05T22:21:31Z")

</div>


