Location of custom Kibana dashboards in ElasticSearch

ecbrodie picture ecbrodie · Feb 26, 2014 · Viewed 45.4k times · Source

I know for a fact that saved Kibana dashboards (ie, the JSON file of the dashboard) are saved in OR associated to a particular ElasticSearch instance. If I were to save my Kibana instance when attached to one server hosting ElasticSearch and I were to switch my ElasticSearch server to another address, I would lose my saved dashboard. But, if I were to switch back to the original server address, I will get the saved dashboard back.

My question, thus, is where exactly in the elasticsearch installation directory are the dashboards saved. I would rather be able to run a script to automatically load my pre-created Kibana dashboards than be forced to copy/paste JSON through the web console every time I start up a new ElasticSearch instance.

Thank you for the help.

UPDATE

According to this Google Groups post, the dashboards are saved into the kibana-int _index with a _type of dashboard and an _id of what I named the . So, to save my dashboards into new ElasticSearch instances, do I just need to execute a PUT into this _index through CURL? Is there a better way to do this?

Answer

Pigueiras picture Pigueiras · Feb 26, 2014

Yes, the Kibana dashboards are being saved in Elasticsearch under kibana-int index (by default, you can override that in the config.js file). If you want to move your Kibana dashboards to another ES cluster you have two options:

  1. Export manually the dashboards. Click on Save -> Advanced -> Export Schema. You have to save the file and then in the new Kibana you have to import click over Load -> Advanced -> Choose File and choosing the file that have selected. This is a pain, because you have to do this operation per dashboard that you want to migrate.
  2. You can use an utility to migrate an ES index from one ES cluster to another. There are some utilities already that can perform this operation. Searching in SO, I found this answer that suggest you to use the Elasticsearch.pm library (Perl :S) to do this. Probably there are more utilities like this but I do not think that doing a script that migrate an index to another cluster is such a difficult task.

EDIT: For the second option, you can use the python elasticsearch library and its helper reindex, if you feel more confortable with Python: https://elasticsearch-py.readthedocs.org/en/latest/helpers.html#elasticsearch.helpers.reindex