Would like to download/export the open search dashboard template from the existing environment. Same template or file can import it to another opensearch dashboard.
Wanted to know is there any file which can be downloaded and then it can be utilised in any of the opensearch dashboard environment?
Basically what I am trying to do is I have created a docker-compose file through which the opensearch an opensearch dashboard is getting created. I have created a sample dashboard for that environment.
Now I have created ansible roles through which I am going to deploy the opensearch an opensearch dashboard so I just wanted to use existing dashboard which have created as an example so that will be using the same dashboard in future deployment during using ansible roles.
Dashboards are exportable via UI/API, you will have JSON so you can use import API during your ansible deployment (after cluster is UP and READY)
Use your web debug console, F12 / CTRL+C and when you export you can get the API used and adapt/modify it.
You can also restore .kibana index (which includes the tenant name)
Hi !
Have you tried the parameter ?overwrite=true ? curl -X POST http://localhost:5601/api/saved_objects/_import?overwrite=true -H “kbn-xsrf: true” --form file=@dashboard.ndjson
Does the dashboard.ndjson exists ?
Check the current directory of the curl command
Don’t forget to add the securitytenant header if you have multi-tenancy enabled
Tried with overwrite=true… Getting the following error message.
*** Closing connection 0** {“statusCode”:404,“error”:“Not Found”,“message”:“Not Found”}Note: Unnecessary use of -X or --request, POST is already inferred.
*** Failed to convert true” to ACE; string contains a disallowed character**
*** Closing connection -1** curl: (3) Failed to convert true” to ACE; string contains a disallowed character
Can you try to add single quotes around file : curl -X POST http://localhost:5601/api/saved_objects/_import?overwrite=true -H "kbn-xsrf: true" --form 'file=@dashboard.ndjson' -vvv
Can you try some GET on /api/saved_objects ?
Like /api/saved_objects/_bulk_get
Edit : Sorry it was not a GET it’s a POST with bulk_get
So try a request like that : /api/saved_objects/_find?type=dashboard&fields=title&fields=type
To check if GET requests are working correctly before POST
Maybe your endpoint has a prefix
I also have 404 not found if my routes/endpoints/URL are not correct
Have you exported the ndjson via API ? /api/saved_objects/_export endpoint
Can you try to add single quotes around file : curl -X POST http://localhost:5601/api/saved_objects/_import?overwrite=true -H "kbn-xsrf: true" --form 'file=@dashboard.ndjson' -vvv → Let me try this out…
Can you try some GET on /api/saved_objects ? → Let me try this out
Like /api/saved_objects/_bulk_get
Have you exported the ndjson via API ? /api/saved_objects/_export endpoint → I have exported using GUI… Let me try export using api and update you…
Not able to export the dashboard using API getting 404 error, as same as import.
{“statusCode”:404,“error”:“Not Found”,“message”:“Not Found”}