LogStash::ConfigurationError", :message=>"Expected one of #, {, ,, ] at line

Dear all,

i am uploading a csv file with the following code

input {
file {
path =>"C:/Users/welcome/Dropbox/IT_Department/ElasticSearchProjects/ResultAnalysis/Data/Semester*.csv"
start_position => "beginning"
sincedb_path => "/dev/null"
}
}
filter {
csv {
separator => ","
columns => [columns => ["CourseCode","CourseTitle","TotalRegistered","AttendFinalExam","TotalDebarred","Pass","Fail","A","AMinus","BPlus","B","BMinus","CPlus","C","CMinus","D","F","NoOFABGrades","NoOFCGrades","NoOFDFGrades","Level","Semester","Department"]
}
mutate {convert => ["TotalRegistered", "integer"] }
mutate {convert => ["AttendFinalExam", "integer"] }
mutate {convert => ["TotalDebarred", "integer"] }
mutate {convert => ["Pass", "integer"] }
mutate {convert => ["Fail", "integer"] }
mutate {convert => ["A", "integer"] }
mutate {convert => ["AMinus", "integer"] }
mutate {convert => ["BPlus", "integer"] }
mutate {convert => ["B", "integer"] }
mutate {convert => ["BMinus", "integer"] }
mutate {convert => ["CPlus", "integer"] }
mutate {convert => ["C", "integer"] }
mutate {convert => ["CMinus", "integer"] }
mutate {convert => ["D", "integer"] }
mutate {convert => ["F", "integer"] }
mutate {convert => ["NoOFABGrades", "integer"] }
mutate {convert => ["NoOFCGrades", "integer"] }
mutate {convert => ["NoOFDFGrades", "integer"] }
}
output {
elasticsearch {
user => admin
password => admin
hosts => "https://hadoop.hct.org"
index => "hctindex"
ssl => false
ssl_certificate_verification => false
cacert => "C:\Elastic\Elasticsearch\6.2.2\config\CN=hadoop.hct.org.crtfull.pem"
document_type => "resultanalysisdocument"
}
stdout {}
}

when i run this code, i receive the following error

C:\Elastic\logstash-6.2.2\bin>logstash -f C:\Users\welcome\Dropbox\IT_Department\ElasticSearchProjects\ResultAnalysis\logstash_ResultAnalysis.config
Sending Logstash's logs to C:/Elastic/logstash-6.2.2/logs which is now configured via log4j2.properties
[2018-04-22T14:56:04,551][INFO ][logstash.modules.scaffold] Initializing module {:module_name=>"fb_apache", :directory=>"C:/Elastic/logstash-6.2.2/modules/fb_apache/configuration"}
[2018-04-22T14:56:04,567][INFO ][logstash.modules.scaffold] Initializing module {:module_name=>"netflow", :directory=>"C:/Elastic/logstash-6.2.2/modules/netflow/configuration"}
[2018-04-22T14:56:04,801][WARN ][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified
[2018-04-22T14:56:05,270][INFO ][logstash.runner ] Starting Logstash {"logstash.version"=>"6.2.2"}
[2018-04-22T14:56:05,692][INFO ][logstash.agent ] Successfully started Logstash API endpoint {:port=>9600}
[2018-04-22T14:56:06,004][ERROR][logstash.agent ] Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"LogStash::ConfigurationError", :message=>"Expected one of #, {, ,, ] at line 11, column 21 (byte 234) after filter {\ncsv {\nseparator => ","\ncolumns => [columns ", :backtrace=>["C:/Elastic/logstash-6.2.2/logstash-core/lib/logstash/compiler.rb:42:in `compile_imperative'", "C:/Elastic/logstash-6.2.2/logstash-core/lib/logstash/compiler.rb:50:in `compile_graph'", "C:/Elastic/logstash-6.2.2/logstash-core/lib/logstash/compiler.rb:12:in `block in compile_sources'", "org/jruby/RubyArray.java:2486:in `map'", "C:/Elastic/logstash-6.2.2/logstash-core/lib/logstash/compiler.rb:11:in `compile_sources'", "C:/Elastic/logstash-6.2.2/logstash-core/lib/logstash/pipeline.rb:51:in `initialize'", "C:/Elastic/logstash-6.2.2/logstash-core/lib/logstash/pipeline.rb:169:in `initialize'", "C:/Elastic/logstash-6.2.2/logstash-core/lib/logstash/pipeline_action/create.rb:40:in `execute'", "C:/Elastic/logstash-6.2.2/logstash-core/lib/logstash/agent.rb:315:in `block in converge_state'", "C:/Elastic/logstash-6.2.2/logstash-core/lib/logstash/agent.rb:141:in `with_pipelines'", "C:/Elastic/logstash-6.2.2/logstash-core/lib/logstash/agent.rb:312:in `block in converge_state'", "org/jruby/RubyArray.java:1734:in `each'", "C:/Elastic/logstash-6.2.2/logstash-core/lib/logstash/agent.rb:299:in `converge_state'", "C:/Elastic/logstash-6.2.2/logstash-core/lib/logstash/agent.rb:166:in `block in converge_state_and_update'", "C:/Elastic/logstash-6.2.2/logstash-core/lib/logstash/agent.rb:141:in `with_pipelines'", "C:/Elastic/logstash-6.2.2/logstash-core/lib/logstash/agent.rb:164:in `converge_state_and_update'", "C:/Elastic/logstash-6.2.2/logstash-core/lib/logstash/agent.rb:90:in `execute'", "C:/Elastic/logstash-6.2.2/logstash-core/lib/logstash/runner.rb:348:in `block in execute'", "C:/Elastic/logstash-6.2.2/vendor/bundle/jruby/2.3.0/gems/stud-0.0.23/lib/stud/task.rb:24:in `block in initialize'"]}

C:\Elastic\logstash-6.2.2\bin>

can anyone guide me what is the problem?

This line looks suspect. Should probably be just columns =>.

1 Like

sincedb_path => "/dev/null"

On Windows use "nul" instead of "/dev/null".

1 Like

thank you so much.

i will keep this in mind.

thanks dear.

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