# How to auto select the appropriate index dynamically in the kibana through discover url

**URL:** <https://discuss.elastic.co/t/how-to-auto-select-the-appropriate-index-dynamically-in-the-kibana-through-discover-url/206210>\
**Category:** Kibana\
**Created:** [November 1, 2019, 7:04pm UTC](https://discuss.elastic.co/t/how-to-auto-select-the-appropriate-index-dynamically-in-the-kibana-through-discover-url/206210 "2019-11-01T19:04:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rockyadi](https://avatars.discourse-cdn.com/v4/letter/r/919ad9/32.png) [@rockyadi](https://discuss.elastic.co/u/rockyadi)\
**Post date:** [November 1, 2019, 7:04pm UTC](https://discuss.elastic.co/t/how-to-auto-select-the-appropriate-index-dynamically-in-the-kibana-through-discover-url/206210/1 "2019-11-01T19:04:31Z")

</div>

We create a dynamic kibana url to the user

[http://localhost:5601/app/kibana#/discover?\_g=(refreshInterval:(pause:!t,value:0),time:(from:'2019-10-16T06:00',to:'2019-10-18T06:00')](http://localhost:5601/app/kibana#/discover?_g=(refreshInterval:(pause:!t,value:0),time:(from:'2019-10-16T06:00',to:'2019-10-18T06:00')))&\_a=(columns:!(\_source),index:'logstash-\*',interval:auto,query:(language:lucene,query:'Error%20Fetching,%20Shipping%20Details'),sort:!(!('@timestamp',desc)))

our index is logstash-\* and it is valid and we would like it be selected when the user clicks on the url ....but we always get this exception that index is not valid .......![scnshot|564x134] even though it is a configured index pattern

![scnshot](https://us1.discourse-cdn.com/elastic/original/3X/b/6/b63b0f6804b1f6262a34c18ecfab413e14a03b02.png)  
We are fairly new to kibana communtity's help in resolving this issue would be of great help

---

<div class="post-metadata">

**Author:** ![Nathan\_Reese](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nathan_reese/32/84829_2.png) [@Nathan\_Reese](https://discuss.elastic.co/u/Nathan_Reese)\
**Post date:** [November 1, 2019, 8:56pm UTC](https://discuss.elastic.co/t/how-to-auto-select-the-appropriate-index-dynamically-in-the-kibana-through-discover-url/206210/2 "2019-11-01T20:56:03Z")

</div>

the `index` url parameter needs to specify the saved object id, not the index pattern title. To view your index pattern id, go to management =\> index patterns and select your index pattern. The URL will contain the id of the saved object. This is the value that should be used in your discover link.

 ![38%20PM](https://us1.discourse-cdn.com/elastic/original/3X/0/c/0c0005705b17c5516e0130e50f69002e3fb0912e.png)

---

<div class="post-metadata">

**Author:** ![rockyadi](https://avatars.discourse-cdn.com/v4/letter/r/919ad9/32.png) [@rockyadi](https://discuss.elastic.co/u/rockyadi)\
**Post date:** [November 5, 2019, 9:48pm UTC](https://discuss.elastic.co/t/how-to-auto-select-the-appropriate-index-dynamically-in-the-kibana-through-discover-url/206210/3 "2019-11-05T21:48:53Z")

</div>

Thank you very much @Nathan_Reese that was really helpful!!

---

<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:** [December 3, 2019, 9:48pm UTC](https://discuss.elastic.co/t/how-to-auto-select-the-appropriate-index-dynamically-in-the-kibana-through-discover-url/206210/4 "2019-12-03T21:48:53Z")

</div>

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