Hello everyone,
I'm trying a few days to enter the csv file data, but I have not been able to take the lead in this error in the date field.
This message:
←[33mFailed parsing date from field {:field=>"Datahora", :value=>"2016-05-09 13: 57:49,B82528,265,\"-22.858118\",\"-43.371143\",0.19", :exception=>"Invalid forma t: \"2016-05-09 13:57:49,B82528,265,\"-22.858118\",\"-43.37...\" is malformed at \",B82528,265,\"-22.858118\",\"-43.37...\"", :config_parsers=>"YYYY-MM-dd HH:mm :ss.SSS", :config_locale=>"default=pt_PT", :level=>:warn}←[0m ←[33mFailed parsing date from field {:field=>"Datahora", :value=>"2016-05-09 13: 59:36,D86095,867,\"-22.931969\",\"-43.574604\",3.52", :exception=>"Invalid forma t: \"2016-05-09 13:59:36,D86095,867,\"-22.931969\",\"-43.57...\" is malformed at \",D86095,867,\"-22.931969\",\"-43.57...\"", :config_parsers=>"YYYY-MM-dd HH:mm :ss.SSS", :config_locale=>"default=pt_PT", :level=>:warn}←[0m{ "message" => "\"2016-05-09 11:28:32,B19524,665,\"\"-22.809641\"\",\"\"-43 .343151\"\",0\"\r", "@version" => "1", "@timestamp" => "2016-06-09T11:54:37.819Z", "path" => "c:/tmp/onibus.csv", "host" => "pc-marcio", "Datahora" => "2016-05-09 11:28:32,B19524,665,\"-22.809641\",\"-43.343151\ ",0", "tags" => [ [0] "_dateparsefailure" ] }
My CSV file:
Datahora,Ordem,Linha,Latitude,Longitude,Velocidade 2016-05-09 00:05:42,D53517,,"-22.883249","-43.495152",0 2016-05-09 00:20:08,B10547,,"-22.86828","-43.25724",0 2016-05-09 00:28:39,C41386,,"-22.8741","-43.241573",0.56 2016-05-09 00:30:29,D53568,,"-22.883801","-43.494732",0 2016-05-09 00:36:32,B58075,621,"-22.837311","-43.28672",27
My logstash_myapp.conf
input {
file {
path => "c:/tmp/onibus.csv"
start_position => "beginning"
}
}
filter {
if [message] =~ /[1]*,/ {
drop { }
}
csv {
separator => ","
columns => ["Datahora","Ordem","Linha","Latitude","Longitude","Velocidade"]
}
date {
match => ["Datahora", "YYYY-MM-dd HH:mm:ss.SSS"]
remove_field => ["Datahora"]
}
mutate {convert => ["Velocidade", "float"]}
}
output {
elasticsearch {
action => "index"
hosts => "localhost"
index => "myapp"
workers => 1
}
stdout { codec => rubydebug}
}
What is wrong?
a-z ↩︎