step 1.I installed logstash in c drive and create a
simple-out.conf file with this code
# file: simple-out.conf
input {
jdbc {
# Postgres jdbc connection string to our database, mydb
jdbc_connection_string => "jdbc:postgresql://127.0.0.1:5432/sortable"
# The user we wish to execute our statement as
jdbc_user => "root"
jdbc_password => ""
# The path to our downloaded jdbc driver
jdbc_driver_library => "../lib/postgresql-9.4.1211.jre6.jar"
# The name of the driver class for Postgresql
jdbc_driver_class => "org.postgresql.Driver"
# our query
statement => "SELECT * from bookmarks"
}
}
output {
stdout { codec => json_lines }
}
step 2: Placed postgresql-9.4.1211.jre6.jar file in to lib directory.
step 3: Open cmd window and run this command
C:\logstash\bin>logstash -f c:\logstash\bin\simple-out.conf
Then we get command prompt return following error::
C:\logstash\bin>logstash -f simple-out.conf
io/console not supported; tty will not be manipulated
Settings: Default pipeline workers: 4
?[31mUnable to connect to database. Tried 1 times {:error_message=>"org.postgres
ql.Driver not loaded, try installing jdbc-postgres gem", :level=>:error}?[0m
?[31mPipeline aborted due to error {:exception=>#<Sequel::AdapterNotFound: org.p
ostgresql.Driver not loaded, try installing jdbc-postgres gem>, :backtrace=>["C:
/logstash/vendor/bundle/jruby/1.9/gems/sequel-4.33.0/lib/sequel/adapters/jdbc.rb
:59:in load_driver'", "C:/logstash/vendor/bundle/jruby/1.9/gems/sequel-4.33.0/l ib/sequel/adapters/jdbc/postgresql.rb:3:in
(root)'", "org/jruby/RubyKernel.java
:1040:in require'", "C:/logstash/vendor/bundle/jruby/1.9/gems/polyglot-0.3.5/li b/polyglot.rb:65:in
require'", "C:/logstash/vendor/bundle/jruby/1.9/gems/sequel
-4.33.0/lib/sequel/database/connecting.rb:1:in (root)'", "C:/logstash/vendor/bu ndle/jruby/1.9/gems/sequel-4.33.0/lib/sequel/database/connecting.rb:98:in
load_
adapter'", "C:/logstash/vendor/bundle/jruby/1.9/gems/sequel-4.33.0/lib/sequel/ad
apters/jdbc.rb:361:in adapter_initialize'", "C:/logstash/vendor/bundle/jruby/1. 9/gems/sequel-4.33.0/lib/sequel/database/misc.rb:146:in
initialize'", "C:/logst
ash/vendor/bundle/jruby/1.9/gems/sequel-4.33.0/lib/sequel/database/connecting.rb
:67:in connect'", "C:/logstash/vendor/bundle/jruby/1.9/gems/sequel-4.33.0/lib/s equel/core.rb:108:in
connect'", "org/jruby/RubyKernel.java:1479:in loop'", "C: /logstash/vendor/bundle/jruby/1.9/gems/logstash-input-jdbc-3.0.2/lib/logstash/pl ugin_mixins/jdbc.rb:109:in
jdbc_connect'", "C:/logstash/vendor/bundle/jruby/1.9
/gems/logstash-input-jdbc-3.0.2/lib/logstash/plugin_mixins/jdbc.rb:106:in jdbc_ connect'", "C:/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-jdbc-3.0.2/l ib/logstash/plugin_mixins/jdbc.rb:158:in
prepare_jdbc_connection'", "C:/logstas
h/vendor/bundle/jruby/1.9/gems/logstash-input-jdbc-3.0.2/lib/logstash/inputs/jdb
c.rb:167:in register'", "org/jruby/RubyArray.java:1613:in
each'", "C:/logstash
/vendor/bundle/jruby/1.9/gems/logstash-core-2.3.1-java/lib/logstash/pipeline.rb:
330:in start_inputs'", "C:/logstash/vendor/bundle/jruby/1.9/gems/logstash-core- 2.3.1-java/lib/logstash/pipeline.rb:329:in
start_inputs'", "C:/logstash/vendor/
bundle/jruby/1.9/gems/logstash-core-2.3.1-java/lib/logstash/pipeline.rb:180:in start_workers'", "C:/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.3.1-j ava/lib/logstash/pipeline.rb:136:in
run'"], :level=>:error}?[0m
stopping pipeline {:id=>"main"}
The signal HUP is in use by the JVM and will not work correctly on this platform
How to fixed this error?