Csv filter ConfigurationError logstash 6.2.2

I am trying to use the CSV filter to read csv file.
First of all, I used an input file plug-in to read the file.
Then, I used CSV to add columns. But I got a very strange error message in the character that follows the CSV filter name which is "{". Even when I tried to use an empty filter like "csv{}" I got the same error :frowning:
Could you please advice...?

Here is the configuration file:

file {

path => "/tmp/test-1.csv"
start_position => "beginning"
tags => ["history"]

}



filter
{

  csv {
           columns => ["lt.si","lt.dm","lt.px","lt.py","lt.pz","lt.sc","lt.as","lt.ap","lt.pn","lt.po","lt.am","lt.ar","lt.apMac","lt.bi","lt.lh","lt.mp","lt.la","lt.lo","lt.created_at"]

     }

}

output
{
     elasticsearch {
                    user => elastic
                    password =>xxxxxx 
               }
}

Here is the error message:

[2018-03-20T09:35:33,719][INFO ][logstash.runner ] Starting Logstash {"logstash.version"=>"6.2.2"}
[2018-03-20T09:35:33,785][INFO ][logstash.agent ] Successfully started Logstash API endpoint {:port=>9600}
[2018-03-20T09:35:33,807][ERROR][logstash.agent ] Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"LogStash::ConfigurationError", :message=>"Expected one of #, => at line 13, column 9 (byte 143) after input\n{\n\nfile {\n path => "/tmp/test-1.csv"\n start_position => "beginning"\n tags => ["history"]\n type => "xps"\n}\n\nfilter\n{\n csv ", :backtrace=>["/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:42:in compile_imperative'", "/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:50:incompile_graph'", "/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:12:in block in compile_sources'", "org/jruby/RubyArray.java:2486:inmap'", "/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:11:in compile_sources'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:51:ininitialize'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:169:in initialize'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline_action/create.rb:40:inexecute'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:315:in block in converge_state'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:141:inwith_pipelines'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:312:in block in converge_state'", "org/jruby/RubyArray.java:1734:ineach'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:299:in converge_state'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:166:inblock in converge_state_and_update'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:141:in with_pipelines'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:164:inconverge_state_and_update'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:90:in execute'", "/usr/share/logstash/logstash-core/lib/logstash/runner.rb:348:inblock in execute'", "/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/stud-0.0.23/lib/stud/task.rb:24:in `block in initialize'"]}

I got it.. thanks

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