Error Uploading a CSV file to Logstash

ELK_carsdata.conf

input{
file{
path => "D:/ELK_Data/carsdata/cars.csv"
start_position => "beginning"
sincedb_path => "NUL"
}
}

filter{
csv{
separator => ","
columns => ["mpg","cylinders"," cubicinches","hp","weightlbs"," time-to-60","year","brand"]
}
mutate{convert => ["mpg", "float"]}
mutate{convert => ["cylinders", "interger"]}
mutate{convert => ["cubicinchies", "interger"]}
mutate{convert => ["hp", "interger"]}
mutate{convert => ["weightlbs", "interger"]}
mutate{convert => ["time-to-60", "interger"]}
mutate{convert => ["year", "interger"]}
}

output{
elasticsearch{
hosts => ["localhost:9200"]
index => "cars"
document_type => "cars_details"
}
stdout{}
}

Error

[2019-06-06T22:23:45,178][ERROR][logstash.javapipeline ] Pipeline aborted due to error {:pipeline_id=>"main", :exception=>#<LogStash::ConfigurationError: translation missing: en.logstash.agent.configuration.invalid_plugin_register>, :backtrace=>["C:/ELK/logstash-7.1.1/vendor/bundle/jruby/2.5.0/gems/logstash-filter-mutate-3.4.0/lib/logstash/filters/mutate.rb:219:in block in register'", "org/jruby/RubyHash.java:1419:ineach'", "C:/ELK/logstash-7.1.1/vendor/bundle/jruby/2.5.0/gems/logstash-filter-mutate-3.4.0/lib/logstash/filters/mutate.rb:217:in register'", "org/logstash/config/ir/compiler/AbstractFilterDelegatorExt.java:56:inregister'", "C:/ELK/logstash-7.1.1/logstash-core/lib/logstash/java_pipeline.rb:191:in block in register_plugins'", "org/jruby/RubyArray.java:1792:ineach'", "C:/ELK/logstash-7.1.1/logstash-core/lib/logstash/java_pipeline.rb:190:in register_plugins'", "C:/ELK/logstash-7.1.1/logstash-core/lib/logstash/java_pipeline.rb:446:inmaybe_setup_out_plugins'", "C:/ELK/logstash-7.1.1/logstash-core/lib/logstash/java_pipeline.rb:203:in start_workers'", "C:/ELK/logstash-7.1.1/logstash-core/lib/logstash/java_pipeline.rb:145:inrun'", "C:/ELK/logstash-7.1.1/logstash-core/lib/logstash/java_pipeline.rb:104:in `block in start'"], :thread=>"#<Thread:0x689d43f8 run>"}
[2019-06-06T22:23:45,753][ERROR][logstash.agent ] Failed to execute action {:id=>:main, :action_type=>LogStash::ConvergeResult::FailedAction, :message=>"Could not execute action: PipelineAction::Create, action_result: false", :backtrace=>nil}

That's not how you spell "integer".

Also, mutate+convert expects a hash, not an array. You can combine them into a single filter call.

mutate{
    convert => {
        "mpg" => "float"
        "cylinders" => "integer"
        "cubicinchies" => "integer"
        "hp" => "integer"
        "weightlbs" => "integer"
        "time-to-60" => "integer"
        "year" => "integer"
    }
}
1 Like

Thanks you so much. I made a silly typo error. And thanks for the explanation given on the mutate command.

Now i have been able to upload the data to the logstash and create an index into kibana.

Thank you so much..!!!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.