# How to get date time filter values in a markdown?

**URL:** <https://discuss.elastic.co/t/how-to-get-date-time-filter-values-in-a-markdown/247792>\
**Category:** Kibana\
**Created:** [September 7, 2020, 5:05pm UTC](https://discuss.elastic.co/t/how-to-get-date-time-filter-values-in-a-markdown/247792 "2020-09-07T17:05:57Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![vinay26](https://avatars.discourse-cdn.com/v4/letter/v/da6949/32.png) [@vinay26](https://discuss.elastic.co/u/vinay26)\
**Post date:** [September 7, 2020, 5:05pm UTC](https://discuss.elastic.co/t/how-to-get-date-time-filter-values-in-a-markdown/247792/1 "2020-09-07T17:05:57Z")

</div>

I need to provide a hyperlink in kibana dashboard which navigates to an external site. At present,  
Created a TSVB and added a markdown to define the URL.

Need to pass the selected date time range as query string to the URL defined in the markdown.

Referring to below thread:  
[[TSVB Visualisation get the filter date Value](https://discuss.elastic.co/t/tsvb-visualisation-get-the-filter-date-value/240309)]

Tried fetching the date time filter from the filter control, but the auto interval time is added to the selected time in the query string.

May I please know how to fetch the exact date time range from filter control in TSVB markdown?

Attached reference screenshots.

 ![URL-configuration](https://us1.discourse-cdn.com/elastic/original/3X/9/5/95d171d5a274b9e8bf506b927a6d26b18ca2d6ee.png) 09)  
 ![starttime-filter](https://us1.discourse-cdn.com/elastic/original/3X/9/0/90b60f335465f236f14e0dded6a181c5254f80b7.png)  
 ![endtime-filter](https://us1.discourse-cdn.com/elastic/original/3X/3/5/35c553dc51f642239da8d56e5bc0fb6a687a9ae3.png)  
 ![auto-interval-added](https://us1.discourse-cdn.com/elastic/original/3X/f/d/fd8475f603ab8378b98a96afbc70cacda4745429.png)

---

<div class="post-metadata">

**Author:** ![wylie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wylie/32/81794_2.png) [@wylie](https://discuss.elastic.co/u/wylie)\
**Post date:** [September 10, 2020, 7:20pm UTC](https://discuss.elastic.co/t/how-to-get-date-time-filter-values-in-a-markdown/247792/3 "2020-09-10T19:20:40Z")

</div>

Can you be specific about what you are expecting to happen? The first screenshot you showed looks correct to me.

---

<div class="post-metadata">

**Author:** ![vinay26](https://avatars.discourse-cdn.com/v4/letter/v/da6949/32.png) [@vinay26](https://discuss.elastic.co/u/vinay26)\
**Post date:** [September 14, 2020, 7:01am UTC](https://discuss.elastic.co/t/how-to-get-date-time-filter-values-in-a-markdown/247792/4 "2020-09-14T07:01:22Z")

</div>

First screenshot shows selected time:  
08:59... to 09:14....

Last screenshot shows the actual time returned:  
09:00:... to 09:00

Expectation is to have the same time value in last screenshot.

I have added Screenshots 2, 3, 4 to demonstrate how date time range is retrieved with aggregation.

---

<div class="post-metadata">

**Author:** ![wylie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wylie/32/81794_2.png) [@wylie](https://discuss.elastic.co/u/wylie)\
**Post date:** [September 14, 2020, 6:35pm UTC](https://discuss.elastic.co/t/how-to-get-date-time-filter-values-in-a-markdown/247792/5 "2020-09-14T18:35:31Z")

</div>

Okay, so my first comment is that you have found a fairly hacky approach to this whole problem.

Your do not need to use `params._all`. Instead, use `params._timestamp` and `params._timestamp + params._interval`.

If you do this, you'll see the interval is set to 3 hours (from your screenshot). To change from 3 hours to the time range in the top right, use Kibana 7.4 or greater and choose "Entire timerange" for the time range mode.

---

<div class="post-metadata">

**Author:** ![vinay26](https://avatars.discourse-cdn.com/v4/letter/v/da6949/32.png) [@vinay26](https://discuss.elastic.co/u/vinay26)\
**Post date:** [September 16, 2020, 2:47pm UTC](https://discuss.elastic.co/t/how-to-get-date-time-filter-values-in-a-markdown/247792/6 "2020-09-16T14:47:16Z")

</div>

Thanks for the response. I have kibana 7.7 & used **params.\_timestamp** for _start time data_ &  
**params.\_timestamp + params.\_interval** for _end time data_.

But unable to fetch the right date time values

Selected datetime range:

 ![1](https://us1.discourse-cdn.com/elastic/original/3X/c/8/c85f618735884db021dd5b310058b504f68a4c11.png)

Actual Result:

 ![2](https://us1.discourse-cdn.com/elastic/original/3X/a/1/a165b55fe327c196c62acdaf20ed7ede5866a8c1.png)

---

<div class="post-metadata">

**Author:** ![wylie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wylie/32/81794_2.png) [@wylie](https://discuss.elastic.co/u/wylie)\
**Post date:** [September 16, 2020, 6:34pm UTC](https://discuss.elastic.co/t/how-to-get-date-time-filter-values-in-a-markdown/247792/7 "2020-09-16T18:34:10Z")

</div>

Sorry, it looks like the instructions I previously wrote were wrong. It seems extremely likely that the behavior you are looking for is not supported in current versions of Kibana. The good news is that we are releasing in 7.10 a feature called **url drilldowns** which should support this use case, but it does mean that it's not currently supported.

---

<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:** [October 14, 2020, 6:34pm UTC](https://discuss.elastic.co/t/how-to-get-date-time-filter-values-in-a-markdown/247792/8 "2020-10-14T18:34:13Z")

</div>

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