I fetch the data through Oracle, and the database has a field updated_at in the format "yyyy-MM-dd HH:mm:ss". However, it has been automatically changed to ISO8601 format in logstash. So I try to change the format "yyyy-MM-dd HH:mm:ss", but I get an error like _dateparsefailure. Here is my config file. What is the problem?
input {
jdbc {
jdbc_validate_connection => true
jdbc_driver_library => "/usr/share/logstash/logstash-core/lib/jars/ojdbc8.jar"
jdbc_driver_class => "Java::oracle.jdbc.OracleDriver"
jdbc_connection_string => <connection string>
jdbc_user => <my username>
jdbc_password => <my password>
use_column_value => true
statement => "SELECT * FROM IP_INFO"
schedule => "*/1 * * * *"
charset => "UTF-8"
enable_metric => false
}
}
filter {
date {
match => [
"updated_at", "yyyy-MM-dd HH:mm:ss"
]
target => "updated_at"
}
}
output {
stdout {
codec => rubydebug
}
}
Result
{
"@timestamp" => 2020-10-14T07:34:03.755Z,
"updated_at" => 2020-10-14T04:44:37.000Z,
"tags" => [
[0] "_dateparsefailure"
],
"created_at" => 2020-09-29T15:56:37.000Z
}
So, I just convert updated_at and created_at field to "yyyy-MM-dd HH:mm:ss". Can you help me?