# How to get time index selected in my custom plugin?

**URL:** <https://discuss.elastic.co/t/how-to-get-time-index-selected-in-my-custom-plugin/94767>\
**Category:** Kibana\
**Created:** [July 27, 2017, 9:55am UTC](https://discuss.elastic.co/t/how-to-get-time-index-selected-in-my-custom-plugin/94767 "2017-07-27T09:55:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ayadirh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ayadirh/32/21617_2.png) [@ayadirh](https://discuss.elastic.co/u/ayadirh)\
**Post date:** [July 27, 2017, 9:55am UTC](https://discuss.elastic.co/t/how-to-get-time-index-selected-in-my-custom-plugin/94767/1 "2017-07-27T09:55:31Z")

</div>

![](https://us1.discourse-cdn.com/elastic/original/3X/c/7/c7aa1b049be4d903d3ff92cf386d482415448189.png)  
I am getting data by querying in my plugin, not from es.response. How can i get the upper and lower time range selected to include in my query?

---

<div class="post-metadata">

**Author:** ![ayadirh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ayadirh/32/21617_2.png) [@ayadirh](https://discuss.elastic.co/u/ayadirh)\
**Post date:** [July 27, 2017, 4:57pm UTC](https://discuss.elastic.co/t/how-to-get-time-index-selected-in-my-custom-plugin/94767/2 "2017-07-27T16:57:05Z")

</div>

Found the way timefilter.getBounds().min /max.  
It is also available in $[scope.timefilter.time.to/from](http://scope.timefilter.time.to/from).

---

<div class="post-metadata">

**Author:** ![rashmi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rashmi/32/16391_2.png) [@rashmi](https://discuss.elastic.co/u/rashmi)\
**Post date:** [July 27, 2017, 9:03pm UTC](https://discuss.elastic.co/t/how-to-get-time-index-selected-in-my-custom-plugin/94767/3 "2017-07-27T21:03:37Z")

</div>

Thanks for posting the reply back here ...

---

<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:** [August 24, 2017, 9:04pm UTC](https://discuss.elastic.co/t/how-to-get-time-index-selected-in-my-custom-plugin/94767/4 "2017-08-24T21:04:00Z")

</div>

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