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.