Using logstash to call jdbc


#1

Hi Graylog,

I installed logstash on graylog server and i configured logstash to call jdbc query on a set of predefined intervals.
Below is my logstash configuration.

input {
  jdbc {
    jdbc_driver_library => "/data/logstash/logstash-6.3.0/lib/sqljdbc42.jar"
    jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver"
    jdbc_connection_string => "jdbc:sqlserver://graylog_server:1525;databaseName=xxx"
    jdbc_user => "xxx"
    jdbc_password => "xxx"
    schedule => "* * * * *"
    statement => "select xxx from XXX table"
  }
}

output {
  elasticsearch { hosts => ["graylog_server:9200"] }
  stdout { codec => rubydebug }
}

Logstash able to call the query and display results in json format, how do i show this results to graylog ?
Can i access the logstash index in graylog?


(Jochen) #2

You could use the GELF output plugin to send the messages to a running GELF input.