# How to import index-pattern in kibana 6 using API?

**URL:** <https://discuss.elastic.co/t/how-to-import-index-pattern-in-kibana-6-using-api/109299>\
**Category:** Kibana\
**Created:** [November 28, 2017, 2:33am UTC](https://discuss.elastic.co/t/how-to-import-index-pattern-in-kibana-6-using-api/109299 "2017-11-28T02:33:48Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![fragatina](https://avatars.discourse-cdn.com/v4/letter/f/ccd318/32.png) [@fragatina](https://discuss.elastic.co/u/fragatina)\
**Post date:** [November 28, 2017, 10:45pm UTC](https://discuss.elastic.co/t/how-to-import-index-pattern-in-kibana-6-using-api/109299/4 "2017-11-28T22:45:15Z")

</div>

After more investigation with the links you provided,  
I've successfully installed a index-pattern in a indirect way.  
I've done it by installing a dashboard. It seems that it also installs the index-patterns that depends on it.

However, I don't see how to set an index-pattern as the defaultIndex using an API.

I see that the defaultIndex is stored in the .kibana config but I don't know how to set it:

# curl -XGET [http://localhost:9200/.kibana/doc/\_search?q=type:config](http://localhost:9200/.kibana/doc/_search?q=type:config)

{"took":1,"timed\_out":false,"\_shards":{"total":1,"successful":1,"skipped":0,"failed":0},"hits":{"total":1,"max\_score":3.205453,"hits":[{"\_index":".kibana","\_type":"doc","\_id":"config:6.0.0","\_score":3.205453,"\_source":{"type":"config","config":{"buildNum":16070,"defaultIndex":"291176c0-cfda-11e7-a5ef-9f5ab64be49e"}}}]}}

Any help on this will be very much appreciated. Thanks.

---

_[View the full topic](https://discuss.elastic.co/t/how-to-import-index-pattern-in-kibana-6-using-api/109299)._
