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

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.

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.