# Reference time picker in timelion query

**URL:** https://discuss.elastic.co/t/reference-time-picker-in-timelion-query/66750
**Category:** Kibana
**Tags:** timelion
**Created:** [November 21, 2016, 3:49pm UTC](https://discuss.elastic.co/t/reference-time-picker-in-timelion-query/66750 "2016-11-21T15:49:21Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![ndev](https://avatars.discourse-cdn.com/v4/letter/n/71e660/32.png) [@ndev](https://discuss.elastic.co/u/ndev)
#### Post date: [November 21, 2016, 3:49pm UTC](https://discuss.elastic.co/t/reference-time-picker-in-timelion-query/66750/1 "2016-11-21T15:49:21Z")

</div>

I have a query that shows the cumulative number of items created in a given period of time. It uses the startTime and endTime as the timefields. The problem is, I want to filter out all of the endTimes which do not have a startTime in the time picker window. Is there any way to use the time picker's start time to use in my query?

This is my current query:

`.cusum(.subtract(.es(index="csaf2",timefield="startTime"), .es(index="csaf2",timefield="endTime")))`

I want it to look something like:

`.cusum(.subtract(.es(index="csaf2",timefield="startTime"), .es(index="csaf2",timefield="endTime",q="startTime:<TIMEPICKER.STARTTIME")))`

---

<div class="post-metadata">

### Author: ![alainc](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@alainc](https://discuss.elastic.co/u/alainc)
#### Post date: [November 22, 2016, 10:16am UTC](https://discuss.elastic.co/t/reference-time-picker-in-timelion-query/66750/2 "2016-11-22T10:16:56Z")

</div>

maybe it can help you

> [@Timelion, dated indices and the time picker](https://discuss.elastic.co/t/timelion-dated-indices-and-the-time-picker/65583/3):
>
> As suggested by @alainc, does changing your timelion functoin to .es(index=outindex-\*, kibana=true) solve the problem?

---

<div class="post-metadata">

### Author: ![ndev](https://avatars.discourse-cdn.com/v4/letter/n/71e660/32.png) [@ndev](https://discuss.elastic.co/u/ndev)
#### Post date: [November 22, 2016, 3:25pm UTC](https://discuss.elastic.co/t/reference-time-picker-in-timelion-query/66750/3 "2016-11-22T15:25:42Z")

</div>

That's not really what I'm looking for. I'm already using the time picker to filter the search, I just need to reference it to see if a document should be further filtered out. It doesn't look like it can be done using `kibana=true` unless I'm missing something.

---

<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 20, 2016, 3:25pm UTC](https://discuss.elastic.co/t/reference-time-picker-in-timelion-query/66750/4 "2016-12-20T15:25:41Z")

</div>

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