Resolving index UUID stored in searchSourceJSON

1k Views Asked by At

I need some help to resolve the UUID that is stored in the searchSourceJSON to the actual index alias name. I exported the (1000+) visualizations using Kibana and many of the visualization definitions contains a UUIDs instead of actual alias names.

{
  "_id": "2c52e0d0-723d-11e7-8d63-57b5a43be1d8",
  "_type": "visualization",
  "_source": {
    "title": "Sample Visualization",
    "visState": "{\"title\":\"Sample Visualization\", ...}",
    "description": "",
    "version": 1,
    "kibanaSavedObjectMeta": {
      "searchSourceJSON": "{\"index\":\"7acb6970-fd58-11e7-9635-4d49af185e70\",\"query\": ...}"
    }
  },
  "_meta": {
    "savedObjectVersion": 2
  }
}

When I go in the visualization in Kibana, I see that the index is an alias as "my.aliased.index", but looking into the exported JSON, I see index: 7acb6970-fd58-11e7-9635-4d49af185e70 for that visualization.

For report purposes, I would like to be able to get back the actual "textual" name of the alias when I only have the UUID.

Thanks

1

There are 1 best solutions below

0
On

I've found where the index-patterns are stored!

GET .kibana/_search
{
  "_source": ["index-pattern.title"],
  "query": {
    "term": {
      "type": "index-pattern"
    }
  }
}

Now I can write a wget query and extract what I need!