# How to create and set default Index in kibana 6.1 using Python

**URL:** https://discuss.elastic.co/t/how-to-create-and-set-default-index-in-kibana-6-1-using-python/119175
**Category:** Kibana
**Created:** [February 9, 2018, 6:49am UTC](https://discuss.elastic.co/t/how-to-create-and-set-default-index-in-kibana-6-1-using-python/119175 "2018-02-09T06:49:51Z")
**Posts on this page:** 1
**Showing post:** 7

<div class="post-metadata">

### Author: ![rajisankar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rajisankar/32/43250_2.png) [@rajisankar](https://discuss.elastic.co/u/rajisankar)
#### Post date: [February 26, 2018, 2:24am UTC](https://discuss.elastic.co/t/how-to-create-and-set-default-index-in-kibana-6-1-using-python/119175/7 "2018-02-26T02:24:49Z")

</div>

How did you create index-patterns? If you had created from UI, the ID of index-pattern would be different from the title. Use the following command to find id.

- curl "[http://localhost:5601/api/saved\_objects?fields=title&search=sample](http://localhost:5601/api/saved_objects?fields=title&search=sample)"

Use the ID of sample2-\* in defaultIndex in the following POST call.

- curl -XPOST -H "Content-Type: application/json" -H "kbn-xsrf: true" localhost:5601/api/kibana/settings/defaultIndex -d '{"value": " **_your-index-id_**"}'

I am guessing that Kibana is looking for a defaultIndex with ID as sample2 and since it doesnt find any, its displaying no index pattern warning.

The latest REST API definitions are available at this page.

> <https://github.com/elastic/kibana/pull/11632>

---

_[View the full topic](https://discuss.elastic.co/t/how-to-create-and-set-default-index-in-kibana-6-1-using-python/119175)._
