4

How can I get kibana dashboard ID? for API call to export data from the dashboard.

I searched everywhere but I can't find ID for dashboard like in example(The dashboard ID is 942dcef0-b2cd-11e8-ad8e-85441f0c2e5c.).

I'm using ELK stack 7.4.1 OSS(Community version).

Sarques
  • 465
  • 7
  • 17
rehan
  • 469
  • 1
  • 7
  • 17

2 Answers2

1

You can query your .kibana index from Command Line 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'

You may refer https://www.elastic.co/guide/en/kibana/current/index.html for more reference

I'm_Pratik
  • 541
  • 8
  • 22
  • I have a dashboard tile called 'Test'. Therefor I enter command like below curl -s 'http://localhost:9200/.kibana/dashboard/_search?pretty=1,q=_title=Test' But i gave a erroe like this {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"Failed to parse value [ – rehan Dec 13 '19 at 06:47
  • Have you tried `curl -s http://localhost:9200/.kibana/dashboard/_search?pretty` ?Because it only allows true and false, so don't put query param like `title` – I'm_Pratik Dec 13 '19 at 06:55
  • I used it but there is no id in that command like(The dashboard ID is 942dcef0-b2cd-11e8-ad8e-85441f0c2e5c) – rehan Dec 13 '19 at 09:45
0

You can find the ID in the URL.

Open the dashboard in Kibana. Extract the part in the URL after <view/> and before <?>.

For http://localhost:5601/app/dashboards#/view/bd1cc200-1169-4ee3-90da-c08d7eaacab5?_g=(filters:!()... the ID is bd1cc200-1169-4ee3-90da-c08d7eaacab5.

API

Alternative you can search and find dashboards using the saved objects API in Kibana:

curl http://localhost:5601/api/saved_objects/_find?type=dashboard

(Using Kibana 7.16)

Niels
  • 176
  • 7