# Can we create index pattern using python script and obtain the id of that index pattern

**URL:** https://discuss.elastic.co/t/can-we-create-index-pattern-using-python-script-and-obtain-the-id-of-that-index-pattern/168321
**Category:** Kibana
**Created:** [February 14, 2019, 2:44am UTC](https://discuss.elastic.co/t/can-we-create-index-pattern-using-python-script-and-obtain-the-id-of-that-index-pattern/168321 "2019-02-14T02:44:44Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![gowda](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gowda/32/40867_2.png) [@gowda](https://discuss.elastic.co/u/gowda)
#### Post date: [February 14, 2019, 2:44am UTC](https://discuss.elastic.co/t/can-we-create-index-pattern-using-python-script-and-obtain-the-id-of-that-index-pattern/168321/1 "2019-02-14T02:44:44Z")

</div>

i am trying to obtain the id of the index pattern that is created from the python script without using the kibana GUI is this possible??if so how??

---

<div class="post-metadata">

### Author: ![shrikantgulia](https://avatars.discourse-cdn.com/v4/letter/s/c68b51/32.png) [@shrikantgulia](https://discuss.elastic.co/u/shrikantgulia)
#### Post date: [February 14, 2019, 5:23am UTC](https://discuss.elastic.co/t/can-we-create-index-pattern-using-python-script-and-obtain-the-id-of-that-index-pattern/168321/2 "2019-02-14T05:23:44Z")

</div>

Hello @gowda,

Yes its possible

---

<div class="post-metadata">

### Author: ![gowda](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gowda/32/40867_2.png) [@gowda](https://discuss.elastic.co/u/gowda)
#### Post date: [February 14, 2019, 1:01pm UTC](https://discuss.elastic.co/t/can-we-create-index-pattern-using-python-script-and-obtain-the-id-of-that-index-pattern/168321/3 "2019-02-14T13:01:07Z")

</div>

do you know how

---

<div class="post-metadata">

### Author: ![chandra0651](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chandra0651/32/30484_2.png) [@chandra0651](https://discuss.elastic.co/u/chandra0651)
#### Post date: [February 14, 2019, 9:27pm UTC](https://discuss.elastic.co/t/can-we-create-index-pattern-using-python-script-and-obtain-the-id-of-that-index-pattern/168321/4 "2019-02-14T21:27:39Z")

</div>

Use below query to retrieve the id of index pattern from .kibana index

```
GET .kibana_1/_search
{
  "query": {
"match": {
  "index-pattern.title": ""
}
  },
  "_source": "{_id}"
}
```

---

<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: [March 14, 2019, 9:27pm UTC](https://discuss.elastic.co/t/can-we-create-index-pattern-using-python-script-and-obtain-the-id-of-that-index-pattern/168321/5 "2019-03-14T21:27:41Z")

</div>

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