Unsuccessful at importing Kibana dashboard JSON via curl

Hello all,
I have been trying to import a saved object json into kibana... I saved ~ 4 index-patterns/100 searches etc.. and I have found recommendations that you can import using curl something like this...

bash-4.2$
bash-4.2$ ls
export.json kibana.yml
bash-4.2$ curl -X POST -H "Content-Type: application/json" -H "kbn-xsrf: true" -d @export.json http://localhost:5601/api/kibana/dashboards/import
{"statusCode":400,"error":"Bad Request","message":""value" must be an object","validation":{"source":"payload","keys":["value"]}}bash-4.2$

Unfortunately as you can see this results in a curl failure...
I have inspected the JSON myself and see that it is actually a list of JSONs... I assume for the respective objects.

Is it possible to bulk import this JSON with multiple objects using a curl like this?
I have tried running this inside my kibana container, outside my docker-compose instance locally, and in another container.

I feel like something obvious is just not sticking out to me any help is appreciated... and unfortunately I can't really share the export.json... however if someone gives me one to test I can give it a go.

Cheers!

Hey @John_Michael_Burke,

Thanks for your question, may I ask you the Kibana version from which you exported the dashboard and the one you want to import the dashboard?

There is a similar issue on Kibana GH repo: https://github.com/elastic/kibana/issues/25790
can you please check if that the same case? TLDR: is the dashboard exported via Kibana UI Management > Saved Objects

I was experiencing this in 6.6.0. I tried importing a dashboard I downloaded via curl and the GUI and neither worked... the only way this works is manually exporting/importing through the GUI. I will be switching to 7.0.0 and see if this resolves the issue.

The export/import functionality from UI or API are not interchangeable. If you export from UI you can import back only from UI. The same is trough AP, you can import it only via API.

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