Configuration error


(Sudhakar N) #1

when i run logstash i am getting below error.

[ERROR] 2018-02-15 09:32:09.497 [Ruby-0-Thread-1: /home/suryakiran/sudhakar/elk/logstash-6.2.1/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/stud-0.0.23/lib/stud/task.rb:22] agent - Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"LogStash::ConfigurationError", :message=>"Expected one of #, {, } at line 5, column 18 (byte 149) after input {\r\n jdbc {\r\n\tjdbc_connection_string=>"jdbc:postgresql://192.168.1.66:5432/mems_mixed_db_2016_11_03"\r\n\tjdbc_user=>"postgres\r\n\tjdbc_password=>"", :backtrace=>["/home/suryakiran/sudhakar/elk/logstash-6.2.1/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:42:in compile_imperative'", "/home/suryakiran/sudhakar/elk/logstash-6.2.1/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:50:incompile_graph'", "/home/suryakiran/sudhakar/elk/logstash-6.2.1/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:12:in block in compile_sources'", "org/jruby/RubyArray.java:2486:inmap'", "/home/suryakiran/sudhakar/elk/logstash-6.2.1/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:11:in compile_sources'", "/home/suryakiran/sudhakar/elk/logstash-6.2.1/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:51:ininitialize'", "/home/suryakiran/sudhakar/elk/logstash-6.2.1/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:169:in initialize'", "/home/suryakiran/sudhakar/elk/logstash-6.2.1/usr/share/logstash/logstash-core/lib/logstash/pipeline_action/create.rb:40:inexecute'", "/home/suryakiran/sudhakar/elk/logstash-6.2.1/usr/share/logstash/logstash-core/lib/logstash/agent.rb:315:in block in converge_state'", "/home/suryakiran/sudhakar/elk/logstash-6.2.1/usr/share/logstash/logstash-core/lib/logstash/agent.rb:141:inwith_pipelines'", "/home/suryakiran/sudhakar/elk/logstash-6.2.1/usr/share/logstash/logstash-core/lib/logstash/agent.rb:312:in block in converge_state'", "org/jruby/RubyArray.java:1734:ineach'", "/home/suryakiran/sudhakar/elk/logstash-6.2.1/usr/share/logstash/logstash-core/lib/logstash/agent.rb:299:in converge_state'", "/home/suryakiran/sudhakar/elk/logstash-6.2.1/usr/share/logstash/logstash-core/lib/logstash/agent.rb:166:inblock in converge_state_and_update'", "/home/suryakiran/sudhakar/elk/logstash-6.2.1/usr/share/logstash/logstash-core/lib/logstash/agent.rb:141:in with_pipelines'", "/home/suryakiran/sudhakar/elk/logstash-6.2.1/usr/share/logstash/logstash-core/lib/logstash/agent.rb:164:inconverge_state_and_update'", "/home/suryakiran/sudhakar/elk/logstash-6.2.1/usr/share/logstash/logstash-core/lib/logstash/agent.rb:90:in execute'", "/home/suryakiran/sudhakar/elk/logstash-6.2.1/usr/share/logstash/logstash-core/lib/logstash/runner.rb:348:inblock in execute'", "/home/suryakiran/sudhakar/elk/logstash-6.2.1/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/stud-0.0.23/lib/stud/task.rb:24:in `block in initialize'"]}
[INFO ] 2018-02-15 09:32:09.808 [Api Webserver] agent - Successfully started Logstash API endpoint {:port=>9600}

And My db.conf file is

input {
jdbc {
jdbc_connection_string=>"jdbc:postgresql://localhpost/mems_mixed_db_2016_11_03"
jdbc_user=>"postgres
jdbc_password=>"postgres
jdbc_validate_connection => true
jdbc_driver_library=>"/home/suryakiran/sudhakar/elk/logstash-6.2.1/usr/share/logstash/drivers/postgresql-42.2.1.jar"
#the name of the driver class for postgres
jdbc_driver_class=>"org.postgresql.Driver"
#our query
statement=>"select ct_ctid,ct_lname from giscities_ref;"
}
}

output {
elasticsearch {
#protocol => http
index=>"cities"
document_type=>"giscities_ref"
document_id =>%{ct_ctid}
host => "localhost:9200"
}
}

please provide the solution


(Mark Walkom) #2

You seem to be missing quite a few closing quotes, eg lines 5 and 6.


(Sudhakar N) #3

i modified the config file and run the logstash. and i got the below error

WARN ] 2018-02-15 10:31:24.653 [LogStash::Runner] multilocal - Ignoring the 'pipelines.yml' file because modules or command line options are specified
[INFO ] 2018-02-15 10:31:24.832 [LogStash::Runner] runner - Starting Logstash {"logstash.version"=>"6.2.1"}
[INFO ] 2018-02-15 10:31:25.000 [Api Webserver] agent - Successfully started Logstash API endpoint {:port=>9600}
[ERROR] 2018-02-15 10:31:25.217 [Ruby-0-Thread-1: /home/suryakiran/sudhakar/elk/logstash-6.2.1/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/stud-0.0.23/lib/stud/task.rb:22] agent - Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"LogStash::ConfigurationError", :message=>"Expected one of #, ", ', -, [, { at line 22, column 19 (byte 674) after output {\r\n elasticsearch {\n #protocol => http\r\n index=>"cities"\r\n document_type=>"giscities_ref"\r\n document_id =>", :backtrace=>["/home/suryakiran/sudhakar/elk/logstash-6.2.1/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:42:in compile_imperative'", "/home/suryakiran/sudhakar/elk/logstash-6.2.1/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:50:incompile_graph'", "/home/suryakiran/sudhakar/elk/logstash-6.2.1/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:12:in block in compile_sources'", "org/jruby/RubyArray.java:2486:inmap'", "/home/suryakiran/sudhakar/elk/logstash-6.2.1/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:11:in compile_sources'", "/home/suryakiran/sudhakar/elk/logstash-6.2.1/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:51:ininitialize'", "/home/suryakiran/sudhakar/elk/logstash-6.2.1/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:169:in initialize'", "/home/suryakiran/sudhakar/elk/logstash-6.2.1/usr/share/logstash/logstash-core/lib/logstash/pipeline_action/create.rb:40:inexecute'", "/home/suryakiran/sudhakar/elk/logstash-6.2.1/usr/share/logstash/logstash-core/lib/logstash/agent.rb:315:in block in converge_state'", "/home/suryakiran/sudhakar/elk/logstash-6.2.1/usr/share/logstash/logstash-core/lib/logstash/agent.rb:141:inwith_pipelines'", "/home/suryakiran/sudhakar/elk/logstash-6.2.1/usr/share/logstash/logstash-core/lib/logstash/agent.rb:312:in block in converge_state'", "org/jruby/RubyArray.java:1734:ineach'", "/home/suryakiran/sudhakar/elk/logstash-6.2.1/usr/share/logstash/logstash-core/lib/logstash/agent.rb:299:in converge_state'", "/home/suryakiran/sudhakar/elk/logstash-6.2.1/usr/share/logstash/logstash-core/lib/logstash/agent.rb:166:inblock in converge_state_and_update'", "/home/suryakiran/sudhakar/elk/logstash-6.2.1/usr/share/logstash/logstash-core/lib/logstash/agent.rb:141:in with_pipelines'", "/home/suryakiran/sudhakar/elk/logstash-6.2.1/usr/share/logstash/logstash-core/lib/logstash/agent.rb:164:inconverge_state_and_update'", "/home/suryakiran/sudhakar/elk/logstash-6.2.1/usr/share/logstash/logstash-core/lib/logstash/agent.rb:90:in execute'", "/home/suryakiran/sudhakar/elk/logstash-6.2.1/usr/share/logstash/logstash-core/lib/logstash/runner.rb:348:inblock in execute'", "/home/suryakiran/sudhakar/elk/logstash-6.2.1/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/stud-0.0.23/lib/stud/task.rb:24:in `block in initialize'"]}

My config file is

input {
jdbc {
jdbc_connection_string=>"jdbc:postgresql://192.168.1.66/mems_mixed_db_2016_11_03"
jdbc_user=>"postgres"
jdbc_password=>"postgres"
jdbc_validate_connection => "true"
jdbc_driver_library=>"/home/suryakiran/sudhakar/elk/logstash-6.2.1/usr/share/logstash/drivers/postgresql-42.2.1.jar"
#the name of the driver class for postgres
jdbc_driver_class=>"org.postgresql.Driver"
#our query
statement=>"select ct_ctid,ct_lname from giscities_ref;"
type => "Database"
tags => ["cities", "import"]
}
}

output {
elasticsearch {
#protocol => http
index=>"cities"
document_type=>"giscities_ref"
document_id =>%{ct_ctid}
host => "localhost:9200"
}
}


(Mark Walkom) #4

That's why.


(system) #5

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