elasticsearchkibanakibana-5

Kibana - given an index, how to find saved objects relying on it?


In Kibana I have many dozens of indices.
Given one of them, I want a way to find all the saved objects (searches/dashboards/visualizations) that rely on this index.

Thanks


Solution

  • You can retrieve the document ID of your index pattern and then use that to search your .kibana index

      {
        "_index" : ".kibana",
        "_type" : "index-pattern",
        "_id" : "AWBWDmk2MjUJqflLln_o",          <---- take this id...
    

    You can use this query on Kibana 5:

    GET .kibana/_search?q=AWBWDmk2MjUJqflLln_o   <---- ...and use it here
    

    You'll find your visualizations:

      {
        "_index" : ".kibana",
        "_type" : "visualization",
        "_id" : "AWBZNJNcMjUJqflLln_s",
        "_score" : 6.2450323,
        "_source" : {
          "title" : "CA groupe",
          "visState" : """{"title":"XXX","type":"pie","params":{"addTooltip":true,"addLegend":true,"legendPosition":"right","isDonut":false,"type":"pie"},"aggs":[{"id":"1","enabled":true,"type":"sum","schema":"metric","params":{"field":"XXX","customLabel":"XXX"}},{"id":"2","enabled":true,"type":"terms","schema":"segment","params":{"field":"XXX","size":5,"order":"desc","orderBy":"1","customLabel":"XXX"}}],"listeners":{}}""",
          "uiStateJSON" : "{}",
          "description" : "",
          "version" : 1,
          "kibanaSavedObjectMeta" : {
            "searchSourceJSON" : """{"index":"AWBWDmk2MjUJqflLln_o","query":{"match_all":{}},"filter":[]}"""
                                                       ^
                                                       |
                                   this is where your index pattern is used
          }
        }
      },