Error while loading data via logstash

(Kushagra Makharia) #1

(base) apples-imac:logstash-6.6.0 apple$ bin/logstash -f /Users/apple/Downloads/logstash-6.6.0/data/app.config
Sending Logstash logs to /Users/apple/Downloads/logstash-6.6.0/logs which is now configured via log4j2.properties
[2019-02-11T18:38:56,894][WARN ][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified
[2019-02-11T18:38:56,910][INFO ][logstash.runner ] Starting Logstash {"logstash.version"=>"6.6.0"}
[2019-02-11T18:38:57,655][ERROR][logstash.agent ] Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"LogStash::ConfigurationError", :message=>"Expected one of #, input, filter, output at line 1, column 1 (byte 1) after ", :backtrace=>["/Users/apple/Downloads/logstash-6.6.0/logstash-core/lib/logstash/compiler.rb:41:in compile_imperative'", "/Users/apple/Downloads/logstash-6.6.0/logstash-core/lib/logstash/compiler.rb:49:incompile_graph'", "/Users/apple/Downloads/logstash-6.6.0/logstash-core/lib/logstash/compiler.rb:11:in block in compile_sources'", "org/jruby/RubyArray.java:2486:inmap'", "/Users/apple/Downloads/logstash-6.6.0/logstash-core/lib/logstash/compiler.rb:10:in compile_sources'", "org/logstash/execution/AbstractPipelineExt.java:149:ininitialize'", "/Users/apple/Downloads/logstash-6.6.0/logstash-core/lib/logstash/pipeline.rb:22:in initialize'", "/Users/apple/Downloads/logstash-6.6.0/logstash-core/lib/logstash/pipeline.rb:90:ininitialize'", "/Users/apple/Downloads/logstash-6.6.0/logstash-core/lib/logstash/pipeline_action/create.rb:42:in block in execute'", "/Users/apple/Downloads/logstash-6.6.0/logstash-core/lib/logstash/agent.rb:92:inblock in exclusive'", "org/jruby/ext/thread/Mutex.java:148:in synchronize'", "/Users/apple/Downloads/logstash-6.6.0/logstash-core/lib/logstash/agent.rb:92:inexclusive'", "/Users/apple/Downloads/logstash-6.6.0/logstash-core/lib/logstash/pipeline_action/create.rb:38:in execute'", "/Users/apple/Downloads/logstash-6.6.0/logstash-core/lib/logstash/agent.rb:317:inblock in converge_state'"]}
[2019-02-11T18:38:57,946][INFO ][logstash.agent ] Successfully started Logstash API endpoint {:port=>9600}

The above error is created when is use

filename= app.config
terminal command: bin/logstash -f /Users/apple/Downloads/logstash-6.6.0/data/app.config

input {
file {
path => “/Users/apple/Downloads/logstash-6.6.0/data/App_data.csv"
start_position => "beginning"
sincedb_path => "/dev/null"
}
}
filter {
csv {
separator => ","
columns => [“id”,”track_name”,”size_bytes”,”app_desc”]
}
}
output {
elasticsearch {
hosts => "http://localhost:9200"
index => “app-data”
document_type => “ios_app”

}
stdout {}
}

Please help

#2

You need to examine the first line of app.config. The first word should be either input, output, filter, or start with #, so that it is a comment. At present it is none of those.

(Kushagra Makharia) #3

Earlier it was "input" as the first word, now I saved a comment as well, still showing the error

(Kushagra Makharia) #4

My mistake. The error has changed a bit

(base) apples-imac:logstash-6.6.0 apple$ bin/logstash -f /Users/apple/Downloads/logstash-6.6.0/data/app.config
Sending Logstash logs to /Users/apple/Downloads/logstash-6.6.0/logs which is now configured via log4j2.properties
[2019-02-11T19:16:58,248][WARN ][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified
[2019-02-11T19:16:58,265][INFO ][logstash.runner ] Starting Logstash {"logstash.version"=>"6.6.0"}
[2019-02-11T19:16:59,150][ERROR][logstash.agent ] Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"LogStash::ConfigurationError", :message=>"Expected one of #, ", ', -, [, { at line 4, column 13 (byte 57) after #Configuration for IOS APP\ninput {\n file {\n path => ", :backtrace=>["/Users/apple/Downloads/logstash-6.6.0/logstash-core/lib/logstash/compiler.rb:41:in compile_imperative'", "/Users/apple/Downloads/logstash-6.6.0/logstash-core/lib/logstash/compiler.rb:49:incompile_graph'", "/Users/apple/Downloads/logstash-6.6.0/logstash-core/lib/logstash/compiler.rb:11:in block in compile_sources'", "org/jruby/RubyArray.java:2486:inmap'", "/Users/apple/Downloads/logstash-6.6.0/logstash-core/lib/logstash/compiler.rb:10:in compile_sources'", "org/logstash/execution/AbstractPipelineExt.java:149:ininitialize'", "/Users/apple/Downloads/logstash-6.6.0/logstash-core/lib/logstash/pipeline.rb:22:in initialize'", "/Users/apple/Downloads/logstash-6.6.0/logstash-core/lib/logstash/pipeline.rb:90:ininitialize'", "/Users/apple/Downloads/logstash-6.6.0/logstash-core/lib/logstash/pipeline_action/create.rb:42:in block in execute'", "/Users/apple/Downloads/logstash-6.6.0/logstash-core/lib/logstash/agent.rb:92:inblock in exclusive'", "org/jruby/ext/thread/Mutex.java:148:in synchronize'", "/Users/apple/Downloads/logstash-6.6.0/logstash-core/lib/logstash/agent.rb:92:inexclusive'", "/Users/apple/Downloads/logstash-6.6.0/logstash-core/lib/logstash/pipeline_action/create.rb:38:in execute'", "/Users/apple/Downloads/logstash-6.6.0/logstash-core/lib/logstash/agent.rb:317:inblock in converge_state'"]}
[2019-02-11T19:16:59,394][INFO ][logstash.agent ] Successfully started Logstash API endpoint {:port=>9600}

#5

Your path option appears to start with curly quotes. Change it to a normal double quote - ".

Same problem for csv/columns and for index and document_type on the output.

(Kushagra Makharia) #6

Hey! Thanks for all your help! The implementation was successful!

(system) closed #7

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