I am fetching rows from db using logstash jdbc input plugin. I have time entry processingtime in my db like;
03-01-17 03:32:50.006000000 PM
and in Logstash, I am using;
date {
match => [ "processingtime", "dd-MM-yy HH:mm:ss.SSS" ]
timezone => "UTC"
target => "@timestamp"
}
But, I am getting the error like;
[2017-01-24T14:36:58,576][WARN ][logstash.filters.date ] Failed parsing date from field {:field=>"processingtime", :value=>2017-01-05T23:08:48.292Z, :exception=>"cannot convert instance of class org.logstash.ext.JrubyTimestampExtLibrary$RubyTimestamp to class java.lang.String", :config_parsers=>"dd-MM-yy HH:mm:ss.SSS aa", :config_locale=>"default=en_US"}
match => [ "txentrytime", "dd-MM-yy HH:mm:ss.SSSSSSSSS AM/PM" ]
No, don't literally put AM/PM there. Use the date pattern token for matching AM/PM, a. Then you should also use hh instead of HH. See DateTimeFormat (Joda time 2.2 API).
match => [ "processingtime", "dd-MM-yy hh:mm:ss.SSSSSSSSS aa" ]
got error
[2017-01-24T15:39:42,487][WARN ][logstash.filters.date ] Failed parsing date from field {:field=>"processingtime", :value=>2017-01-03T04:19:34.934Z, :exception=>"cannot convert instance of class org.logstash.ext.JrubyTimestampExtLibrary$RubyTimestamp to class java.lang.String", :config_parsers=>"dd-MM-yy hh:mm:ss.SSSSSSSSS aa", :config_locale=>"default=en_US"}
Oh. Where does the timestamp come from, a jdbc input? If so, perhaps you can convert the timestamp to a string in the query? Otherwise I think the only option is to use a ruby filter to convert the timestamp to a string that the date filter can process.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.