# Update index patterns automatically - programatically?

**URL:** <https://discuss.elastic.co/t/update-index-patterns-automatically-programatically/129547>\
**Category:** Kibana\
**Created:** [April 25, 2018, 6:25pm UTC](https://discuss.elastic.co/t/update-index-patterns-automatically-programatically/129547 "2018-04-25T18:25:04Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![jen-huang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jen-huang/32/74327_2.png) [@jen-huang](https://discuss.elastic.co/u/jen-huang)\
**Post date:** [April 25, 2018, 6:37pm UTC](https://discuss.elastic.co/t/update-index-patterns-automatically-programatically/129547/2 "2018-04-25T18:37:05Z")

</div>

Currently there is no great way to do this. Eventually we would like to expose an API for this, or refresh fields automatically. You can track this issue on GitHub here: [Remove index pattern mapping cache · Issue #6498 · elastic/kibana · GitHub](https://github.com/elastic/kibana/issues/6498)

There is a workaround solution provided here:

> [@Reloading the Index Field list automatically](https://discuss.elastic.co/t/reloading-the-index-field-list-automatically/116687/2):
>
> i don't think there is an API call to do that, but you could do it with a few steps: get the list of fields in the index pattern with: http://localhost:5601/api/index\_patterns/\_fields\_for\_wildcard?pattern=NAME\_OF\_YOUR\_INDEX&meta\_fields=["\_source","\_id","\_type","\_index","\_score"], escape returned json and update the index with: curl 'http://localhost:5601/api/saved\_objects/index-pattern/ID\_OF\_YOUR\_INDEX' -X PUT -H 'Content-Type: application/json' -H "kbn-xsrf: true" --data-binary '{"attri…

---

_[View the full topic](https://discuss.elastic.co/t/update-index-patterns-automatically-programatically/129547)._
