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
In version 1.0.0+ of ElasticSearch the snapshot and restore APIs have been made available:
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-snapshots.html
http://chrissimpson.co.uk/elasticsearch-snapshot-restore-api.html
This enables you to quickly back-up (snapshot) and restore every, or any, index that is on any given cluster. Thus you might want to look at upgrading to that version, since this will give you a simple API call to take a snapshot of the "kibana-int" index, and restore that index to any other cluster.
For kibana 4, I found the default index value in config/kibana.yml file and it was ".kibana"
Following is the line from kibana configuration file.
kibana_index: ".kibana"
And here is the query that displayed me the required results
curl -XGET http://localhost:9200/.kibana/_search?type=dashboard&pretty=1
In fact, very easy, Copy two folders:
1) .\elasticsearch\data\nodes\0\indices\.kibana
2) .\elasticsearch\data\nodes\0\indices\kibana-int
paste in new elasticsearch.
As others have said, you can find all of the objects that Kibana saves in the .kibana index within elasticsearch.
The most recent versions of Kibana 4 include an export and import feature that makes moving objects from one installation to another very easy. You can find this functionality by clicking the "settings" and then "objects" tabs.
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:
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
Here's a standalone Python script that can copy Kibana dashboards from elasticsearch host to another.
#!/bin/env python
"""Migrate all the kibana dashboard from SOURCE_HOST to DEST_HOST.
This script may be run repeatedly, but any dashboard changes on
DEST_HOST will be overwritten if so.
"""
import urllib2, urllib, json
SOURCE_HOST = "your-old-es-host"
DEST_HOST = "your-new-es-host"
def http_post(url, data):
request = urllib2.Request(url, data)
return urllib2.urlopen(request).read()
def http_put(url, data):
opener = urllib2.build_opener(urllib2.HTTPHandler)
request = urllib2.Request(url, data)
request.get_method = lambda: 'PUT'
return opener.open(request).read()
if __name__ == '__main__':
old_dashboards_url = "http://%s:9200/kibana-int/_search" % SOURCE_HOST
# All the dashboards (assuming we have less than 9999) from
# kibana, ignoring those with _type: temp.
old_dashboards_query = """{
size: 9999,
query: { filtered: { filter: { type: { value: "dashboard" } } } } }
}"""
old_dashboards_results = json.loads(http_post(old_dashboards_url, old_dashboards_query))
old_dashboards_raw = old_dashboards_results['hits']['hits']
old_dashboards = {}
for doc in old_dashboards_raw:
old_dashboards[doc['_id']] = doc['_source']
for id, dashboard in old_dashboards.iteritems():
put_url = "http://%s:9200/kibana-int/dashboard/%s" % (DEST_HOST, urllib.quote(id))
print http_put(put_url, json.dumps(dashboard))