# Is there a way to dynamically add "Create an index pattern" for open dashboards?

**URL:** <https://forum.opensearch.org/t/is-there-a-way-to-dynamically-add-create-an-index-pattern-for-open-dashboards/9102>\
**Category:** OpenDistro\
**Tags:** discuss\
**Created:** [March 31, 2022, 2:07pm UTC](https://forum.opensearch.org/t/is-there-a-way-to-dynamically-add-create-an-index-pattern-for-open-dashboards/9102 "2022-03-31T14:07:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mugambi\_k](https://avatars.discourse-cdn.com/v4/letter/m/ccd318/32.png) [@mugambi\_k](https://forum.opensearch.org/u/mugambi_k)\
**Post date:** [March 31, 2022, 2:07pm UTC](https://forum.opensearch.org/t/is-there-a-way-to-dynamically-add-create-an-index-pattern-for-open-dashboards/9102/1 "2022-03-31T14:07:10Z")

</div>

Open Dashboards “Create index pattern” using an API or some sort of hack?

Any pointers in the right direction would be of great help.

---

<div class="post-metadata">

**Author:** ![nateynate](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/nateynate/32/4913_2.png) [@nateynate](https://forum.opensearch.org/u/nateynate)\
**Post date:** [March 31, 2022, 6:17pm UTC](https://forum.opensearch.org/t/is-there-a-way-to-dynamically-add-create-an-index-pattern-for-open-dashboards/9102/2 "2022-03-31T18:17:30Z")

</div>

Thanks for asking, @mugambi_k ! I went to find the documentation on this subject, and I was shocked when I couldn’t find it either!

I shall file a documentation update on your behalf and see if I can’t find an engineer who knows the answer to your question.

Thanks again!

Nate

---

<div class="post-metadata">

**Author:** ![mugambi\_k](https://avatars.discourse-cdn.com/v4/letter/m/ccd318/32.png) [@mugambi\_k](https://forum.opensearch.org/u/mugambi_k)\
**Post date:** [March 31, 2022, 7:35pm UTC](https://forum.opensearch.org/t/is-there-a-way-to-dynamically-add-create-an-index-pattern-for-open-dashboards/9102/3 "2022-03-31T19:35:52Z")

</div>

I found a hack solution below:  
[https://stackoverflow.com/questions/58270749/dynamic-index-pattern-kibana](https://stackoverflow.com/questions/58270749/dynamic-index-pattern-kibana)

Seems to work ok for now.

```auto
POST .kibana/_doc/index-pattern:<index-name>
{
  "type" : "index-pattern",
  "index-pattern" : {
    "title": "index-*", ---> pattern to match index
    "timeFieldName": "execution_time" ---> Time field
  }
}

```

---

<div class="post-metadata">

**Author:** ![dfournout](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@dfournout](https://forum.opensearch.org/u/dfournout)\
**Post date:** [April 6, 2022, 3:50pm UTC](https://forum.opensearch.org/t/is-there-a-way-to-dynamically-add-create-an-index-pattern-for-open-dashboards/9102/4 "2022-04-06T15:50:11Z")

</div>

The best is to use the dashboard API (Kibana API)

> **[Create saved objects API | Kibana Guide \[7.11\] | Elastic](https://www.elastic.co/guide/en/kibana/7.11/saved-objects-api-create.html)**

I’m using it to create both indices, visualizations and dashboards
