6.6: Kibana API: get object/create object not compatible, mark index pattern as default via API?


#1

Hi there,

I'm playing around with the (relatively) new "saved objects" API and programmatically populating Kibana.

In 5.4 I used to dump the .kibana index and (re)create it. (Because there was no other way to populate Kibana besides the frontend - ugly, but it worked just good enough)

Under 6.6 I struggle for two reasons:

First: I can not use the create object api to (re-)import data generated with the get object api. I have to modify the exported data (drop id, updated_at, ...), there seems to be no way to import it otherwise.

Is this a known limitation and will be fixed in a future version? In my opinion the create object API should work with data exported by the get object API.

Second: If the imported index is the first one to be created I have still can't use it out of the box, because it seems to have to manually "star" the index pattern to set it as the default pattern.

Is there a way to set an index pattern as default pattern using the Kibana API?


(Jen Huang) #2

Hi, can you share an example of an object that was retrieved with Get Object API, but can't be imported with the Create Object API? I agree that the output of get should be compatible with create.

It is not possible to set an index pattern as "default" through the saved object API, because that state is stored as a Kibana Advanced Setting (defaultIndex). That setting might be able to be updated through updating the corresponding .kibana doc, however.