Update:
As stated below, I have a file with 3,951,165 csv llines that process properly with the config file shown below. In this, I get 153 lines that fail with dateparsefailure. After looking at the ruby debug output, the lines that fail all have the date and time of :
2017-03-12,2 where 2 is the hour.
Taking one line and experimenting with it, if I change the date to anything other 2017-03-12 or change the hour to anything other than 2 it works!.
The only conclusion I can make is the date parse code has an error in it.!! Test line shown below:
2017-03-12,2,APPL,PAY,AXK1,AX,2.0035000000000001E-3,0,3.7102000000000001E-4,0,2,4,1.2999999999999999E-3,SYSQ,DCSLPLEX,0.0
I have a really weird problem. I get 153 _dateparsefailure errors on 3951165 csv lines. The date field fails on line:
"message" => "2017-03-12,2,CICS,QM1,ZZZZ,ZZ,2.8401899999999998E-3,0,5.2596000000000001E-4,0,9,9,1.6000000000000001E-3,DZBP,CBSADPLX,",
i.e. 2017-03-12,2 where we have date and hour. i.e (,2).
All other lines parse properly.
Here is the logstash filter portion that handles Date.
mutate {
add_field => { "timestamp" => "%{ObsDate}:%{ObsHour}" }
}
mutate {
# Extract the '-' symbol from the date string. We do this because we cannot convert a string in this format.
# therefore what we do is remove the '-' and replace with an empty space.
gsub => [ "timestamp", "\-", " " ]
}
# "2017-03-12,12 => 2017 03 12:12
#
date {
match => [ "timestamp", "yyyy MM dd:HH" , "dd MMM yy:HH"]
target => "@timestamp"
}
from the ruby output:
"timestamp" => "2017 03 12:2"
"ObsHour" => 2,
Can anyone help me with this? I have spent the better part of two days on this.