Kibana Export Saved Objects API

Hello guys !
I’m looking for some documentation about Export API on a secured Open Distro for Elasticsearch Kibana.

I found out that the right URL is : http://localhost:5601/api/kibana/management/saved_objects/scroll/export

So I can save every saved objects of a particular tenant, my accounts only have one tenant.
But I would like to be able to choose which tenant I would like to save stuffs from.

Is it possible?
I saw in Search Guard documentation that they allow it with the “sgtenant” parameter.

curl \
   -u hr_employee:hr_employee \
   -H "sgtenant: management" \
   -H 'Content-Type: application/json' \
   -H "kbn-xsrf: true" \
   -XGET "http://localhost:5601/api/saved_objects"

Search Guard Documentation

My main goal is to make one account that backup saved objects of each tenants.

Thank you for reading.

I was wondering the same thing. I looked through the source code and found this section. Looks like if you add a header securitytenant: mytenant this will behave like you want.

1 Like

@ThibaudF Did you manage to get this? I’m interested in importing and exporting visualizations and dashboards, but the endpoints seem to be different from the ones in the original documentation.

Hi @DMinovski,

As mentioned and explained by @jleezer I digged into the security-kibana-plugin repository and reached the same conclusion. Adding the header securitytenant: mytenant solved my issue.

1 Like

@jleezer Thanks, adding that header works. On another topic, someone posted the correct code for importing too: