Kibana : Is there a way to get dashboards from command line?

In Kibana Settings/Objects menu, i can see all of my dashboards, charts and searches.

I can choose to export one or more of them and then i get a JSON object representing that item.

Is there a way to do this from command line? Where are the dashboards stored in elasticsearch? Is there a

You can query your .kibana index in your Elasticsearch with something like this;

$ curl -s http://localhost:9200/.kibana/dashboard/_search?pretty
{
  "took" : 1,
  "timed_out" : false,
  "_shards" : {
    "total" : 1,
    "successful" : 1,
    "failed" : 0
  },
  "hits" : {
    "total" : 1,
    "max_score" : 1.0,
    "hits" : [ {
      "_index" : ".kibana",
      "_type" : "dashboard",
      "_id" : "New-Dashboard",
      "_score" : 1.0,
      "_source" : {
        "title" : "New Dashboard",
        "hits" : 0,
        "description" : "",
        "panelsJSON" : "[{\"id\":\"Visualization-VerticalBarChart\",\"type\":\"visualization\",\"panelIndex\":1,\"size_x\":3,\"size_y\":2,\"col\":1,\"row\":1}]",
        "optionsJSON" : "{\"darkTheme\":false}",
        "uiStateJSON" : "{}",
        "version" : 1,
        "timeRestore" : false,
        "kibanaSavedObjectMeta" : {
          "searchSourceJSON" : "{\"filter\":[{\"query\":{\"query_string\":{\"query\":\"*\",\"analyze_wildcard\":true}}}]}"
        }
      }
    } ]
  }
}

Or if you want individual ones you can include the title or the id;

curl -s 'http://localhost:9200/.kibana/dashboard/_search?pretty=1,q=_id=New-Dashboard'

2 Likes

yup, thats it. thanks