# Get IndexPaterrn

**URL:** <https://discuss.elastic.co/t/get-indexpaterrn/144848>\
**Category:** Kibana\
**Created:** [August 17, 2018, 8:10am UTC](https://discuss.elastic.co/t/get-indexpaterrn/144848 "2018-08-17T08:10:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![voix](https://avatars.discourse-cdn.com/v4/letter/v/87869e/32.png) [@voix](https://discuss.elastic.co/u/voix)\
**Post date:** [August 17, 2018, 8:10am UTC](https://discuss.elastic.co/t/get-indexpaterrn/144848/1 "2018-08-17T08:10:55Z")

</div>

Hello there. How can I get IndexPattern in my plugin? Plugin failed when i just use courier.indexPatterns.get(id) with or without an argument. I can see the func when i console.log it [https://i.imgur.com/41hHZk3.png](https://i.imgur.com/41hHZk3.png) but when i call the func, my plugin failed. It shows only white screen without any error [https://i.imgur.com/xfZCgT5.png](https://i.imgur.com/xfZCgT5.png) How can I get IndexPattern by id in my Plugin?

---

<div class="post-metadata">

**Author:** ![timroes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timroes/32/19712_2.png) [@timroes](https://discuss.elastic.co/u/timroes)\
**Post date:** [August 17, 2018, 8:12am UTC](https://discuss.elastic.co/t/get-indexpaterrn/144848/2 "2018-08-17T08:12:49Z")

</div>

the approach is actually the correct one, you are sure you are properly waiting for the promise to resolve and that this id also exists that you are trying to load? (Remember it's the id of the index pattern, not it's name.)

---

<div class="post-metadata">

**Author:** ![voix](https://avatars.discourse-cdn.com/v4/letter/v/87869e/32.png) [@voix](https://discuss.elastic.co/u/voix)\
**Post date:** [August 17, 2018, 9:30am UTC](https://discuss.elastic.co/t/get-indexpaterrn/144848/3 "2018-08-17T09:30:49Z")

</div>

There is console.log result of find index-patterns and id that i pass to the func. [https://i.imgur.com/gPxgkQI.png](https://i.imgur.com/gPxgkQI.png) All this invoke inside resolve method of route. I tried to just copy/paste from discover, but it also doesnt work [https://i.imgur.com/nLSqpbM.png](https://i.imgur.com/nLSqpbM.png). No error, just not load.

---

<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 14, 2018, 9:30am UTC](https://discuss.elastic.co/t/get-indexpaterrn/144848/4 "2018-09-14T09:30:49Z")

</div>

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