# Kibana displays Unix default date

**URL:** <https://discuss.elastic.co/t/kibana-displays-unix-default-date/60850>\
**Category:** Kibana\
**Created:** [September 19, 2016, 8:29am UTC](https://discuss.elastic.co/t/kibana-displays-unix-default-date/60850 "2016-09-19T08:29:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mahdy\_S](https://avatars.discourse-cdn.com/v4/letter/m/59ef9b/32.png) [@Mahdy\_S](https://discuss.elastic.co/u/Mahdy_S)\
**Post date:** [September 19, 2016, 8:29am UTC](https://discuss.elastic.co/t/kibana-displays-unix-default-date/60850/1 "2016-09-19T08:29:06Z")

</div>

I have uploaded some logs using logstash where I have read the `@timestamp` field from the logs timestamp using the `date` filter. I needed to make a histogram based on the hour of the day for all days (i.e. to have values from 0 to 23 on the x-axis and have the sum on all days on the y-axis). Therefore, I created a new field in the `grok` filter which reads the hour, minute and seconds from the timestamp and saves it in a seperate field called "time".

Before parsing the logs with logstash I used the following query to setup an index in ES and configure the field as a field of type `date`:  
curl -XPUT [http://localhost:9200/indexname](http://localhost:9200/indexname) -d '  
{  
"mappings" : {  
"_default_" : {  
"properties" : {  
"time" : {"type": "date", "format" : "HH:mm:ss.SSS" },  
}  
}  
}  
}  
';

Now when visualizing the results in Kibana using a date histogram, everything works as expected. Except that it gives the default date, which is 1-1-1970 beside the hour, since the field "time" has no date. Is there anyway to stop this so that I have on the x-axis only the hours from 0 to 23?  
I have used a workaround which is to read the hours only and to save them as integers. This has the drawback that the histogram can have a precision of one hour only (which in the other case would be up to 1 millisecond).  
Kibana version is 4.5.1.

---

<div class="post-metadata">

**Author:** ![jbudz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jbudz/32/45922_2.png) [@jbudz](https://discuss.elastic.co/u/jbudz)\
**Post date:** [September 19, 2016, 7:47pm UTC](https://discuss.elastic.co/t/kibana-displays-unix-default-date/60850/2 "2016-09-19T19:47:07Z")

</div>

It doesn't seem to be supported, my original thought was to use field formatters but the date histogram seems to use its own formatting. There's an issue filed at [https://github.com/elastic/kibana/issues/5069](https://github.com/elastic/kibana/issues/5069).

If you're using a date range aggregation field formatters will work:

 ![](https://us1.discourse-cdn.com/elastic/original/2X/4/43ec72a9cba70d33fbd8bbbd71b53a60955e295d.png). You can get to this screen by clicking on the icon in the controls column from the index pattern page for your index.

---

<div class="post-metadata">

**Author:** ![Mahdy\_S](https://avatars.discourse-cdn.com/v4/letter/m/59ef9b/32.png) [@Mahdy\_S](https://discuss.elastic.co/u/Mahdy_S)\
**Post date:** [September 26, 2016, 7:54am UTC](https://discuss.elastic.co/t/kibana-displays-unix-default-date/60850/3 "2016-09-26T07:54:59Z")

</div>

Thanks for the answer! I have tried to change the format of the field as you suggested and in the date histogram I still see the same old format with month and year as you have pointed out. The problem is that I cannot use a normal histogram because this is a field of type "date" so if I choose the normal histogram I cannot find it in the drop down menu which only shows numeric fields (integers, floating points, ...etc.).

---

<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, 1:38pm UTC](https://discuss.elastic.co/t/kibana-displays-unix-default-date/60850/4 "2017-07-06T13:38:12Z")

</div>


