# Kibana Index Pattern via API

**URL:** <https://discuss.elastic.co/t/kibana-index-pattern-via-api/244957>\
**Category:** Kibana\
**Created:** [August 14, 2020, 1:30am UTC](https://discuss.elastic.co/t/kibana-index-pattern-via-api/244957 "2020-08-14T01:30:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Venkatesh\_Guruprasad](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/venkatesh_guruprasad/32/50887_2.png) [@Venkatesh\_Guruprasad](https://discuss.elastic.co/u/Venkatesh_Guruprasad)\
**Post date:** [August 14, 2020, 1:30am UTC](https://discuss.elastic.co/t/kibana-index-pattern-via-api/244957/1 "2020-08-14T01:30:45Z")

</div>

I have used API to create ES indexes. Unfortunately Kibana Index Patterns doesn't get auto-generated when we do that. I have tried using the following API call

curl -X POST "[http://localhost:5601/api/saved\_objects/index-pattern/iwantotestmyindexpattern](http://localhost:5601/api/saved_objects/index-pattern/iwantotestmyindexpattern)" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d '  
{  
"attributes": {  
"title":"iwanttotestmyindex\*",  
"timeFieldName":"execution\_time"  
}  
}'

It creates the index pattern but doesn't associate any fields with that which is already available part of the ES indicies.

---

<div class="post-metadata">

**Author:** ![mattkime](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mattkime/32/43522_2.png) [@mattkime](https://discuss.elastic.co/u/mattkime)\
**Post date:** [August 14, 2020, 12:16pm UTC](https://discuss.elastic.co/t/kibana-index-pattern-via-api/244957/2 "2020-08-14T12:16:25Z")

</div>

Add a single field object to the saved object missing searchable, aggregatable, or readFromDocValues and the field list will be generated next time a user with index pattern edit privileges loads the index pattern. - `src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts:171`

It should be noted that we aim to directly address this use case in future releases.

---

<div class="post-metadata">

**Author:** ![Venkatesh\_Guruprasad](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/venkatesh_guruprasad/32/50887_2.png) [@Venkatesh\_Guruprasad](https://discuss.elastic.co/u/Venkatesh_Guruprasad)\
**Post date:** [August 14, 2020, 1:25pm UTC](https://discuss.elastic.co/t/kibana-index-pattern-via-api/244957/3 "2020-08-14T13:25:42Z")

</div>

If I am using the elastic cloud version there is no way to achieve this correct. What you are suggesting is if we have a installed it ourselves.

My use case is to continuosly updates bulk csv data on a daily basis. What is the best way to solve this without having to use the Kibana UI.

---

<div class="post-metadata">

**Author:** ![mattkime](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mattkime/32/43522_2.png) [@mattkime](https://discuss.elastic.co/u/mattkime)\
**Post date:** [August 14, 2020, 3:16pm UTC](https://discuss.elastic.co/t/kibana-index-pattern-via-api/244957/4 "2020-08-14T15:16:33Z")

</div>

Sorry, I communicated my intention poorly - thats the code my suggested change will trigger. You do not need to modify it.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 11, 2020, 3:16pm UTC](https://discuss.elastic.co/t/kibana-index-pattern-via-api/244957/5 "2020-09-11T15:16:43Z")

</div>

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