# Kibana Timeserie data on select timerange

**URL:** <https://discuss.elastic.co/t/kibana-timeserie-data-on-select-timerange/252047>\
**Category:** Kibana\
**Created:** [October 14, 2020, 1:17pm UTC](https://discuss.elastic.co/t/kibana-timeserie-data-on-select-timerange/252047 "2020-10-14T13:17:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nibeckj](https://avatars.discourse-cdn.com/v4/letter/n/65b543/32.png) [@Nibeckj](https://discuss.elastic.co/u/Nibeckj)\
**Post date:** [October 14, 2020, 1:17pm UTC](https://discuss.elastic.co/t/kibana-timeserie-data-on-select-timerange/252047/1 "2020-10-14T13:17:34Z")

</div>

Hello,

I have some index with data.  
@timestamp is unix timestamp.

how do for have a timseries grafic with data only between 08h-20h every day ?

---

<div class="post-metadata">

**Author:** ![thomasneirynck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thomasneirynck/32/23313_2.png) [@thomasneirynck](https://discuss.elastic.co/u/thomasneirynck)\
**Post date:** [October 14, 2020, 1:22pm UTC](https://discuss.elastic.co/t/kibana-timeserie-data-on-select-timerange/252047/2 "2020-10-14T13:22:50Z")

</div>

hi @Nibeckj,

create a scripted-field [https://www.elastic.co/guide/en/kibana/current/scripted-fields.html](https://www.elastic.co/guide/en/kibana/current/scripted-fields.html) on your index pattern that reads out the hour.

There's an example on how to get the hour from a timestamp here [https://www.elastic.co/blog/using-painless-kibana-scripted-fields](https://www.elastic.co/blog/using-painless-kibana-scripted-fields) . Scroll down to `* **Example** : Parse date into hour-of-day"`. Make sure the `@timestamp` field is of `type: date` in the Elasticsearch-mapping.

Then you can create a `between` filter in Kibana on that scripted-field, where the value needs to be between `8` and `20`.

---

<div class="post-metadata">

**Author:** ![Nibeckj](https://avatars.discourse-cdn.com/v4/letter/n/65b543/32.png) [@Nibeckj](https://discuss.elastic.co/u/Nibeckj)\
**Post date:** [October 16, 2020, 9:59am UTC](https://discuss.elastic.co/t/kibana-timeserie-data-on-select-timerange/252047/3 "2020-10-16T09:59:52Z")

</div>

Hello @thomasneirynck,

Thnaks for your answer.  
It's good with scriplet.

Hours Of Day : doc['@timestamp'].value.hourOfDay  
Days Of Week : doc['@timestamp'].value.dayOfWeek

---

<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:** [November 13, 2020, 9:59am UTC](https://discuss.elastic.co/t/kibana-timeserie-data-on-select-timerange/252047/4 "2020-11-13T09:59:54Z")

</div>

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