I want to pull logs from an mssql server and parse their date strings. unfortunately I can not figure out why it can not parse the date. My filter looks like this:
I'm a bit suprised that it works for you. I can't find anything why it might not but it doesn't. Starting logstahs with --debug doesn't give any hint that it can't process the date string. Is there another way to get the date filter to give more information thand adding [ tag_on_failure ]?
I hadn't configured it explicitly, the JDBC Plugin already gives it as JSON. But when I configure json explicitly it doesn't change. It still does not process the date without giving any hint on why.
The fingerprinting-filter does work so I guess it is not a problem of reading the input in general.
I wonder if you are hitting this issue. The jdbc input will convert date/time columns into LogStash::Timestamp objects, which a date filter cannot parse. You could try using mutate+convert to make [evtime] a string before parsing it.
Thanks a lot @Badger, this seems to be the problem. Not that I'm suprised. Since I started with elastic in June I found bug after bug. Since elastic had this logstash prepared for me, saying „this should work“ I thought it might be a problem with my environment. But I'll test it after the holidays and ask them to have a look.
So, after the holidays I had the time to test it and it is definateley that issue. It is a bit frustrating that the documentation doesn't mention that the input type for date hast to be a string and that there is no useful error message suggesting the type mismatch. That could have saved me a lot of time but at least it is consistend with what I saw when encountering bugs in the other elastic components.
So if anyone else stumbles onto this thread:
The jdbc plugin seem to receive dates as type date. The date filter isn't able to process dates as dates and wants a string (but doesnt tell you... because its a log funnier to have this bug for over 3 years and let everyone stumble over it). Fix:
filter {
mutate {
convert => {"date_fileld" => "string"}
}
date {
match => ["date_fileld", "ISO8601"]
}
}
Many thanks @Badger for pointing me to that issue.
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.