# Date histogram on time component only?

**URL:** https://discuss.elastic.co/t/date-histogram-on-time-component-only/1249
**Category:** Kibana
**Created:** [May 25, 2015, 10:06am UTC](https://discuss.elastic.co/t/date-histogram-on-time-component-only/1249 "2015-05-25T10:06:18Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Pieter\_Agenbag](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pieter_agenbag/32/4562_2.png) [@Pieter\_Agenbag](https://discuss.elastic.co/u/Pieter_Agenbag)
#### Post date: [May 25, 2015, 10:06am UTC](https://discuss.elastic.co/t/date-histogram-on-time-component-only/1249/1 "2015-05-25T10:06:19Z")

</div>

I dont know if I'm going about this the wrong way , but I'd like to create a date histogram based on the time component of a dat/timestamp field only ... so that I can "split lines" on the date component , effectively overlaying each days data on top of each other.

I have a timestamp field (date+time) and I can create a date only field, making the splitting lines easy - but if I create a time only field , ES analyses it as a string (and I cant figure out how to specify a time only field type/analyser) .

Also , ideally I'd prefer to use the existing timestamp field and not need to add separate date and time fields.

I believe this used to be easy with groovy scripts , but this is not available anymore? Even so - would the date histogram allow a time only ?  
Maybe there is a completely different approach to achieving this ?

regards.  
Pieter

---

<div class="post-metadata">

### Author: ![peterColclough](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/petercolclough/32/44777_2.png) [@peterColclough](https://discuss.elastic.co/u/peterColclough)
#### Post date: [May 25, 2015, 4:26pm UTC](https://discuss.elastic.co/t/date-histogram-on-time-component-only/1249/2 "2015-05-25T16:26:29Z")

</div>

One Klunky approach would be to have seperate Date queries.. but thats a lot of work for a rolling scenario. The ES Date types cover Time formats too ([https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-date-format.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-date-format.html)) so would it be possible to have an extra time field in your mapping, and then allow Kibana to use that?

---

<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 6, 2017, 2:19pm UTC](https://discuss.elastic.co/t/date-histogram-on-time-component-only/1249/3 "2017-07-06T14:19:07Z")

</div>


