# Logstash date parse failure error

**URL:** <https://discuss.elastic.co/t/logstash-date-parse-failure-error/47566>\
**Category:** Logstash\
**Created:** [April 16, 2016, 7:23pm UTC](https://discuss.elastic.co/t/logstash-date-parse-failure-error/47566 "2016-04-16T19:23:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![shan](https://avatars.discourse-cdn.com/v4/letter/s/7ab992/32.png) [@shan](https://discuss.elastic.co/u/shan)\
**Post date:** [April 16, 2016, 7:23pm UTC](https://discuss.elastic.co/t/logstash-date-parse-failure-error/47566/1 "2016-04-16T19:23:50Z")

</div>

Hi ,

I'm getting the date parse failure error., Please help me on this

{:timestamp=\>"2016-04-16T15:21:57.639000-0400", :message=\>"Failed parsing date from field", :field=\>"timestamp", :value=\>"2016-04-16 19:21:54", :exception=\>"Invalid format: "2016-04-16 19:21:54" is too short", :config\_parsers=\>"yyyy-MM-dd HH:mm:ss,SSS", :config\_locale=\>"default=en\_US", :level=\>:warn}

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [April 16, 2016, 8:35pm UTC](https://discuss.elastic.co/t/logstash-date-parse-failure-error/47566/2 "2016-04-16T20:35:13Z")

</div>

Please show your config and a sample piece of data.  
What version are you on?

---

<div class="post-metadata">

**Author:** ![jervdv](https://avatars.discourse-cdn.com/v4/letter/j/ed655f/32.png) [@jervdv](https://discuss.elastic.co/u/jervdv)\
**Post date:** [April 16, 2016, 8:56pm UTC](https://discuss.elastic.co/t/logstash-date-parse-failure-error/47566/3 "2016-04-16T20:56:14Z")

</div>

> [@shan](#):
>
> 2016-04-16 19:21:54

If this is an example of a date in your logfile "2016-04-16 19:21:54".  
You should use this format "yyyy-MM-dd HH:mm:ss" and not "yyyy-MM-dd HH:mm:ss,SSS".  
I didn't test this out but you can find all the information at [this website](http://www.joda.org/joda-time/apidocs/org/joda/time/format/DateTimeFormat.html) about custom date formats.

---

<div class="post-metadata">

**Author:** ![shan](https://avatars.discourse-cdn.com/v4/letter/s/7ab992/32.png) [@shan](https://discuss.elastic.co/u/shan)\
**Post date:** [April 16, 2016, 9:34pm UTC](https://discuss.elastic.co/t/logstash-date-parse-failure-error/47566/4 "2016-04-16T21:34:54Z")

</div>

Hi,

Logstash version is logstash-2.2.4 . My sample config is

if [type] == "test" {  
if [host] == "hostname" {  
date {  
match =\> ["timestamp", "yyyy-MM-dd HH:mm:ss,SSS"]  
target =\> "@timestamp"  
}

Getting like this in logstash.stdout

"timestamp" =\> "2016-04-16 21:26:59",  
"@version" =\> "1",  
"@timestamp" =\> "2016-04-16T21:26:53.325Z",  
"host" =\> "hostanme",  
"type" =\> "test",  
"tags" =\> [  
[0] "\_dateparsefailure"

---

<div class="post-metadata">

**Author:** ![jervdv](https://avatars.discourse-cdn.com/v4/letter/j/ed655f/32.png) [@jervdv](https://discuss.elastic.co/u/jervdv)\
**Post date:** [April 22, 2016, 1:00pm UTC](https://discuss.elastic.co/t/logstash-date-parse-failure-error/47566/5 "2016-04-22T13:00:17Z")

</div>

If this is your sample date 2016-04-16 19:21:54  
and this is your format yyyy-MM-dd HH:mm:ss,SSS  
You need to delete the miliseconds (SSS) --\> yyyy-MM-dd HH:mm:ss

---

<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, 5:01am UTC](https://discuss.elastic.co/t/logstash-date-parse-failure-error/47566/6 "2017-07-06T05:01:06Z")

</div>


