Hello,
I'm trying to load data from PostgreSQL Server to Elasticsearch so as to use it in Kibana for visualization purpose. But while connecting it with Logstash, I'm not getting any index. I'm attaching my logstash configuration file for the review, and the output that I'm getting after running Logstash.
Please suggest some solution.
.conf file
input {
jdbc {
# Postgres jdbc connection string to our database, mydb
jdbc_connection_string => "jdbc:postgresql://localhost:49526/<dbname>"
# The user we wish to execute our statement as
jdbc_user => "user"
#password for the user
jdbc_password => "password"
# The path to our downloaded jdbc driver
jdbc_driver_library => "D:/KIBANA/postgresql-42.2.6.jar"
# The name of the driver class for Postgresql
jdbc_driver_class => "org.postgresql.Driver"
# our query
statement => "SELECT * from <dbname>"
#sinceDB file path
sincedb_path => "D:/KIBANA/"
}
}
output {
elasticsearch { protocol => http }
stdout { codec => json_lines }
}
Following is the output that I'm getting after executing the .conf file:
D:\KIBANA\logstash-6.6.2\bin>logstash -f test7.conf
Sending Logstash logs to D:/KIBANA/logstash-6.6.2/logs which is now configured via log4j2.properties
[2019-07-03T16:57:58,779][WARN ][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified
[2019-07-03T16:57:58,808][INFO ][logstash.runner ] Starting Logstash {"logstash.version"=>"6.6.2"}
*[2019-07-03T16:57:59,495][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=>["D:/KIBANA/logstash-6.6.2/logstash-core/lib/logstash/compiler.rb:41:in `compile_imperative'", "D:/KIBANA/logstash-6.6.2/logstash-core/lib/logstash/compiler.rb:49:in `compile_graph'", "D:/KIBANA/logstash-6.6.2/logstash-core/lib/logstash/compiler.rb:11:in `block in compile_sources'", "org/jruby/RubyArray.java:2486:in `map'", "D:/KIBANA/logstash-6.6.2/logstash-core/lib/logstash/compiler.rb:10:in `compile_sources'", "org/logstash/execution/AbstractPipelineExt.java:149:in `initialize'", "D:/KIBANA/logstash-6.6.2/logstash-core/lib/logstash/pipeline.rb:22:in `initialize'", "D:/KIBANA/logstash-6.6.2/logstash-core/lib/logstash/pipeline.rb:90:in `initialize'", "D:/KIBANA/logstash-6.6.2/logstash-core/lib/logstash/pipeline_action/create.rb:43:in `block in execute'", "D:/KIBANA/logstash-6.6.2/logstash-core/lib/logstash/agent.rb:94:in `block in exclusive'", "org/jruby/ext/thread/Mutex.java:148:in `synchronize'", "D:/KIBANA/logstash-6.6.2/logstash-core/lib/logstash/agent.rb:94:in `exclusive'", "D:/KIBANA/logstash-6.6.2/logstash-core/lib/logstash/pipeline_action/create.rb:39:in `execute'", "D:/KIBANA/logstash-6.6.2/logstash-core/lib/logstash/agent.rb:327:in `block in converge_state'"]}
[2019-07-03T16:57:59,795][INFO ][logstash.agent ] Successfully started Logstash API endpoint {:port=>9600}