# Does kibana have a api about creating indexpattern?

**URL:** <https://discuss.elastic.co/t/does-kibana-have-a-api-about-creating-indexpattern/149381>\
**Category:** Kibana\
**Created:** [September 21, 2018, 3:01am UTC](https://discuss.elastic.co/t/does-kibana-have-a-api-about-creating-indexpattern/149381 "2018-09-21T03:01:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![whoami](https://avatars.discourse-cdn.com/v4/letter/w/a9a28c/32.png) [@whoami](https://discuss.elastic.co/u/whoami)\
**Post date:** [September 21, 2018, 3:01am UTC](https://discuss.elastic.co/t/does-kibana-have-a-api-about-creating-indexpattern/149381/1 "2018-09-21T03:01:41Z")

</div>

does kibana have a api about creating indexpattern?  
I wanna create indexpattern in background

---

<div class="post-metadata">

**Author:** ![TheSmartMonkey](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thesmartmonkey/32/33965_2.png) [@TheSmartMonkey](https://discuss.elastic.co/u/TheSmartMonkey)\
**Post date:** [September 21, 2018, 12:15pm UTC](https://discuss.elastic.co/t/does-kibana-have-a-api-about-creating-indexpattern/149381/2 "2018-09-21T12:15:15Z")

</div>

Hi @whoami here is how you can create an index pattern with a curl command :

```auto
curl -f -XPOST -H 'Content-Type: application/json' -H 'kbn-xsrf: anything' 'http://localhost:5601/api/saved_objects/index-pattern/logstash-*' '-d{"attributes":{"title":"logstash-*","timeFieldName":"@timestamp"}}'

```

Just change the 2 logstash-\* to whatever pattern you want

---

<div class="post-metadata">

**Author:** ![whoami](https://avatars.discourse-cdn.com/v4/letter/w/a9a28c/32.png) [@whoami](https://discuss.elastic.co/u/whoami)\
**Post date:** [September 26, 2018, 4:50am UTC](https://discuss.elastic.co/t/does-kibana-have-a-api-about-creating-indexpattern/149381/3 "2018-09-26T04:50:44Z")

</div>

thank you

---

<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:** [October 24, 2018, 4:51am UTC](https://discuss.elastic.co/t/does-kibana-have-a-api-about-creating-indexpattern/149381/4 "2018-10-24T04:51:21Z")

</div>

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