Kibana SaveObject API

HI Support,

How to Import selective save object using Curl Command. I do not want to import IndexPattern using curl API from ndjson file.

Hi @mhr,

What request did you try so far?
Did you check official documentation for import API?

Regards, Dzmitry

I tried using the .ndjson content from the file directly in the request body (payload) with the parameter -d, the same way that indices are created and can be used by copying the content from a file into the request body. I used the header

-H "Content-Type: application/x-ndjson"
too but it returns

{"statusCode":415,"error":"Unsupported Media Type","message":"Unsupported Media Type"}

Is it possible to send saved object directly and not from file? The command:

curl -u username:password -XPOST "http://localhost:5601/api/saved_objects/_import?overwrite=true" -H "Content-Type: application/json" -H 'kbn-xsrf: true' -H 'securitytenant: Global' -d '{"type":"index-pattern","id":"my-pattern","attributes":{"title":"my-pattern-*"}}'

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