Config File:
input{
file{
path =>"C:\logstash-7.2.0\config\cars.csv"
start_position => "beginning"
sincedb_path => "C:\dev\null"
}
}
filter{
csv{
separator=> ","
columns=> ["maker", "model", "mileage", "manufacture_year", "engine_displacement", "engine_power", "body_type", "color_slug", "stk_year", "transmission", "door_count", "seat_count", "fuel_type", "date_created", "date_last_seen", "price_eur"]
}
mutate{convert => ["mileage", "integer"]}
mutate{convert => ["price_eur", "float"]}
mutate{convert => ["engine_power", "integer"]}
mutate{convert => ["door_count", "integer"]}
mutate{convert => ["seat_count", "integer"]}
}
output {
elasticsearch{
hosts => ["localhost:9200"]
index => ["cars"]
document_type => "sold_cars"
}
stdout {}
}
Error in Windows CMD:
C:\logstash-7.2.0\bin>logstash.bat -f C:\Users\VikrantMittal\Desktop\Data\Logstash_cars.config
Thread.exclusive is deprecated, use Thread::Mutex
Sending Logstash logs to C:/logstash-7.2.0/logs which is now configured via log4j2.properties
[2019-08-01T14:00:41,064][WARN ][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified
[2019-08-01T14:00:41,083][INFO ][logstash.runner ] Starting Logstash {"logstash.version"=>"7.2.0"}
[2019-08-01T14:00:42,248][ERROR][logstash.agent ] Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"LogStash::ConfigurationError", :message=>"Expected one of #, {, } at line 10, column 16 (byte 168) after input{\r\n\tfile{\r\n\t\tpath =>"C:\logstash-7.2.0\config\cars.csv"\r\n\t\tstart_position => "beginning"\r\n\t\tsincedb_path => "C:\dev\null\"\r\n\t}\r\n}\r\nfilter{\r\n\tcsv{\r\n\t\tseparator=> "", :backtrace=>["C:/logstash-7.2.0/logstash-core/lib/logstash/compiler.rb:41:in compile_imperative'", "C:/logstash-7.2.0/logstash-core/lib/logstash/compiler.rb:49:in
compile_graph'", "C:/logstash-7.2.0/logstash-core/lib/logstash/compiler.rb:11:in block in compile_sources'", "org/jruby/RubyArray.java:2577:in
map'", "C:/logstash-7.2.0/logstash-core/lib/logstash/compiler.rb:10:in compile_sources'", "org/logstash/execution/AbstractPipelineExt.java:151:in
initialize'", "org/logstash/execution/JavaBasePipelineExt.java:47:in initialize'", "C:/logstash-7.2.0/logstash-core/lib/logstash/java_pipeline.rb:24:in
initialize'", "C:/logstash-7.2.0/logstash-core/lib/logstash/pipeline_action/create.rb:36:in execute'", "C:/logstash-7.2.0/logstash-core/lib/logstash/agent.rb:325:in
block in converge_state'"]}
[2019-08-01T14:00:42,876][INFO ][logstash.agent ] Successfully started Logstash API endpoint {:port=>9600}
[2019-08-01T14:00:47,780][INFO ][logstash.runner ] Logstash shut down.