# Date range missing in discover section of kibana

**URL:** <https://discuss.elastic.co/t/date-range-missing-in-discover-section-of-kibana/336913>\
**Category:** Kibana\
**Tags:** kql-kibana-query-language\
**Created:** [June 26, 2023, 1:59pm UTC](https://discuss.elastic.co/t/date-range-missing-in-discover-section-of-kibana/336913 "2023-06-26T13:59:02Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tukaram](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tukaram/32/118944_2.png) [@Tukaram](https://discuss.elastic.co/u/Tukaram)\
**Post date:** [June 26, 2023, 1:59pm UTC](https://discuss.elastic.co/t/date-range-missing-in-discover-section-of-kibana/336913/1 "2023-06-26T13:59:02Z")

</div>

Hi,

when I select my index, date range part(near refresh button) gets removed from the display and I only see KQL search field.  
stack version 7.17.3

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [June 26, 2023, 2:41pm UTC](https://discuss.elastic.co/t/date-range-missing-in-discover-section-of-kibana/336913/2 "2023-06-26T14:41:50Z")

</div>

Hi @Tukaram

This typically means that the index pattern does not have a Time Field associated with it, therefore no time range can be set.

You may need to re-create the index pattern correctly and pick the correct field to use for the time field then date range / time picker should show in Discover

---

<div class="post-metadata">

**Author:** ![Tukaram](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tukaram/32/118944_2.png) [@Tukaram](https://discuss.elastic.co/u/Tukaram)\
**Post date:** [June 26, 2023, 2:44pm UTC](https://discuss.elastic.co/t/date-range-missing-in-discover-section-of-kibana/336913/3 "2023-06-26T14:44:24Z")

</div>

is there any rest api to add existing date field from document as date range?

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [June 26, 2023, 3:07pm UTC](https://discuss.elastic.co/t/date-range-missing-in-discover-section-of-kibana/336913/4 "2023-06-26T15:07:35Z")

</div>

> [@Tukaram](#):
>
> is there any rest api to add existing date field from document as date range?

Perhaps take a look at this, but for some reason, I thought the Time Field had to be set at creation time... try it.

> **[Update index pattern API | Kibana Guide \[8.11\] | Elastic](https://www.elastic.co/guide/en/kibana/current/index-patterns-api-update.html)**

Kibana API make sure to look at [this](https://www.elastic.co/guide/en/kibana/current/api.html) to make sure you use the REST API Correctly

---

<div class="post-metadata">

**Author:** ![Tukaram](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tukaram/32/118944_2.png) [@Tukaram](https://discuss.elastic.co/u/Tukaram)\
**Post date:** [June 26, 2023, 3:46pm UTC](https://discuss.elastic.co/t/date-range-missing-in-discover-section-of-kibana/336913/5 "2023-06-26T15:46:36Z")

</div>

thanks a lot, I added a scripted date field. Anyway I can set that for date range purpose?

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [June 26, 2023, 5:33pm UTC](https://discuss.elastic.co/t/date-range-missing-in-discover-section-of-kibana/336913/6 "2023-06-26T17:33:04Z")

</div>

I would have created a runtime field not scripted and added it to the actual mapping.  
Then I think you can use it in the index pattern

---

<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:** [July 24, 2023, 5:33pm UTC](https://discuss.elastic.co/t/date-range-missing-in-discover-section-of-kibana/336913/7 "2023-07-24T17:33:23Z")

</div>

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