# Date parsing failure error

**URL:** <https://discuss.elastic.co/t/date-parsing-failure-error/169203>\
**Category:** Logstash\
**Created:** [February 20, 2019, 12:15pm UTC](https://discuss.elastic.co/t/date-parsing-failure-error/169203 "2019-02-20T12:15:16Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![vsingh](https://avatars.discourse-cdn.com/v4/letter/v/b4bc9f/32.png) [@vsingh](https://discuss.elastic.co/u/vsingh)\
**Post date:** [February 20, 2019, 12:15pm UTC](https://discuss.elastic.co/t/date-parsing-failure-error/169203/1 "2019-02-20T12:15:16Z")

</div>

Hello there,

I am getting dateparsingfailure error when running logstash-6.4.0.

```
This is my database column and its values
sno reference_id dateofbirth post_date
7979 2671254433 1990-01-31 2017-01-19 10:22:53

```

Config file:   
input {  
jdbc {  
jdbc\_connection\_string =\> "jdbc:mysql://localhost:3306/testdb?zeroDateTimeBehavior=convertToNull"  
jdbc\_user =\> "root"  
jdbc\_password =\> "mysql"  
jdbc\_driver\_library =\> "C:\mysql-connector-java-8.0.13.jar"  
jdbc\_driver\_class =\> "com.mysql.cj.jdbc.Driver"  
statement =\> "select sno, reference\_id, dateofbirth, post\_date from testdb.sample"  
type =\> "response"  
}  
}  
filter {  
if [type] == "response" {  
date {  
match =\> ["dateofbirth","YYYY-MM-dd"]  
timezone=\> "Asia/Kolkata"  
target =\> "dateofbirth"  
}  
date {  
match =\> ["post\_date","YYYY-MM-dd HH:mm:ss"]  
timezone=\> "Asia/Kolkata"  
target =\> "post\_date"  
}  
}  
}  
output {  
if [type] == "response" {  
elasticsearch {  
index =\> "sample\_index"  
document\_id =\> "%{reference\_id}"  
hosts =\> "localhost:9200"  
}  
stdout {  
codec =\> rubydebug  
}  
}  
}

this is the response:  
{  
"tags" =\> [  
[0] "\_dateparsefailure"  
],  
"post\_date" =\> 2017-01-19T10:22:53.000Z,  
"dateofbirth" =\> 1990-01-31T18:30:00.000Z,  
"@version" =\> "1",  
"reference\_id" =\> "2671254433",  
"@timestamp" =\> 2019-02-20T12:25:30.623Z,  
"sno" =\> 7979,  
"type" =\> "response"  
}

Please suggest.  
Thanks.

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [February 20, 2019, 12:58pm UTC](https://discuss.elastic.co/t/date-parsing-failure-error/169203/2 "2019-02-20T12:58:49Z")

</div>

I suspect, given that post\_date does not get moved to a different timezone, that post\_date is being returned as a timestamp from the database, so a date filter cannot parse it. Can you try just commenting out the second date filter?

---

<div class="post-metadata">

**Author:** ![vsingh](https://avatars.discourse-cdn.com/v4/letter/v/b4bc9f/32.png) [@vsingh](https://discuss.elastic.co/u/vsingh)\
**Post date:** [February 20, 2019, 1:21pm UTC](https://discuss.elastic.co/t/date-parsing-failure-error/169203/3 "2019-02-20T13:21:12Z")

</div>

Thanks for reply.  
It is giving the same error when i comment second date filter (post\_date).

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [February 20, 2019, 1:25pm UTC](https://discuss.elastic.co/t/date-parsing-failure-error/169203/4 "2019-02-20T13:25:09Z")

</div>

Actually it is possible the same is true of the first date filter. You may not need any date filters at all.

---

<div class="post-metadata">

**Author:** ![vsingh](https://avatars.discourse-cdn.com/v4/letter/v/b4bc9f/32.png) [@vsingh](https://discuss.elastic.co/u/vsingh)\
**Post date:** [February 21, 2019, 9:05am UTC](https://discuss.elastic.co/t/date-parsing-failure-error/169203/5 "2019-02-21T09:05:33Z")

</div>

Thanks for reply.

I have run after commented the date filters. but now, it increases timestamp value.  
for example: my database value is: '2014-12-15 10:30:33'  
and in elastic search it is showing: "2014-12-15T05:00:33.000Z"

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [February 21, 2019, 1:16pm UTC](https://discuss.elastic.co/t/date-parsing-failure-error/169203/6 "2019-02-21T13:16:35Z")

</div>

Perhaps the [jdbc\_default\_timezone](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-jdbc.html#plugins-inputs-jdbc-jdbc_default_timezone) option would help?

---

<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:** [March 21, 2019, 1:16pm UTC](https://discuss.elastic.co/t/date-parsing-failure-error/169203/7 "2019-03-21T13:16:38Z")

</div>

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