Importing dashboards via CLI 5.1.1


#1

What I want to do is import the .json dashboards that Kibana generates with:

Management -> Saved Objects -> Export

And then import them via command line or something that can be automated and doesn't require me to use the web interface. Is this possible to do ?


Import dashboards etc via command line
(Shaunak Kashyap) #2

Hi @Mormaii,

While I don't know of a CLI tool that would let you easily import saved objects into Kibana, you could write a small program to do it yourself, if you are up to it. The things you would need to be aware of are:

  • These saved objects are stored in a special index in Elasticsearch (default: .kibana).
  • The exported JSON is an array of objects. Each object represents a saved object in Kibana. Each object is a document in the special Elasticsearch index I mentioned above.

So essentially you could write a program to loop over the array in the exported JSON and index each of those documents into the special index under the appropriate _type and with the right _id. If you have a lot of saved objects, you might consider using Elasticsearch's bulk API.

One big caveat: The structure of the special Elasticsearch index used by Kibana for storing saved objects could change at any time. If this happens your program would need to be updated.


(Helene Joanin) #3

Hi @shaunak
It would be great if this kind of tool came with Kibana.
Why it doesn't ?
Regards.
Hélene Joanin.


(system) #4

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