Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

importing of dashboards and saved objects fails via api #25790

Closed
ghost opened this issue Nov 16, 2018 · 3 comments
Closed

importing of dashboards and saved objects fails via api #25790

ghost opened this issue Nov 16, 2018 · 3 comments
Labels
stale Used to mark issues that were closed for being stale Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc

Comments

@ghost
Copy link

ghost commented Nov 16, 2018

Kibana version:
6.4

Elasticsearch version:
6.4

Server OS version:
CentOS Linux release 7.1.1503 (Core)

Original install method (e.g. download page, yum, from source, etc.):
yum

Describe the bug:
I'm trying to import a dashboard (including saved objects) via the api as documented here:
https://www.elastic.co/guide/en/kibana/current/dashboard-import-api-import.html
This however fails, following error is returned:

"Bad Request", "message": ""value" must be an object", "statusCode": 400

Steps to reproduce:

  1. Create a dashboard
  2. Export via Management > Saved Objects
  3. Reimport the exported json file via the api.

Expected behavior:
An imported dashboard including saved objects
Any additional context:
Same question was asked on kibana forum but no answer yet: https://discuss.elastic.co/t/importing-kibana-json-files-using-kibana-api-call/155344/2

@thomasneirynck thomasneirynck added the Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc label Nov 19, 2018
@hieutle2011
Copy link

It seems that you can only import the exported json file the same way you exported it; as the different ways produce different json file (Kibana UI will produce json file with a list, API will produce json file with an object). In your case, you exported file via Kibana UI and using API to import it, that's the reason.

@craigboman
Copy link

The better question is, why do the two export methods result in different file formats? The two exports should be identical and we should be able to import/export via either method using the same .ndjson file.

@joshdover joshdover added the stale Used to mark issues that were closed for being stale label Jan 14, 2021
@rudolf
Copy link
Contributor

rudolf commented Oct 29, 2021

Kibana 7.2 and later introduced the Saved Objects Import/Export API which are compatible with the files generated from the Import/Export UI https://www.elastic.co/guide/en/kibana/current/saved-objects-api-import.html

@rudolf rudolf closed this as completed Oct 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Used to mark issues that were closed for being stale Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
Projects
None yet
Development

No branches or pull requests

5 participants