How to skip kibana discover and directly go to dashboard, and use the index pattern I created by directly using elasticsearch APIs

I am trying to import the index-pattern as well as visualization object, dashboard etc not going through kibana GUI but elasticsearch API. After I have the data ready(The .kibana index is fully populated). It keep asking me to "Configure an index pattern", and keep redirect my request to the discover page.

Is there any way to by pass that? My dashboard and visual obejct as well as the index-pattern I created are already there in the .kibana index. I do not want to create another index-pattern

Hi Xin,

You want to set the defaultIndex in the config doc in the .kibana index.
You can see it if you run this query in the dev tools console;

GET .kibana/config/_search
{
  "query": {
    "match_all": {}
  }
}

Near the very bottom you see the defaultIndex (which in this case is already set);

{
  "took": 0,
  "timed_out": false,
  "_shards": {
    "total": 1,
    "successful": 1,
    "failed": 0
  },
  "hits": {
    "total": 1,
    "max_score": 1,
    "hits": [
      {
        "_index": ".kibana",
        "_type": "config",
        "_id": "5.5.0",
        "_score": 1,
        "_source": {
          "buildNum": 15347,
          "xPackMonitoring:allowReport": true,
          "xPackMonitoring:showBanner": true,
          "defaultIndex": "logstash-*"
        }
      }
    ]
  }
}

To set that value if it's undefined, or to change it, you can use the update api like this;

POST .kibana/config/5.5.0/_update
{
  "doc" : {
    "defaultIndex": "metricbeat-*"
  }
}

Where 5.5.0 is the id (shown as _id) above.

WARNING: modifying the .kibana index directly like this is unsupported. Use at your own risk. Backup, Snapshot, etc.

Reference: https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update.html

Regards,
Lee

This is what I am doing now, Thanks
Xin

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.