Querying databases

You must download the JDBC driver from the database vendor webpage. The tracking column must be a sequence, but if you don't have a tracking column you can use the row timestamp.


input {


  jdbc {
    jdbc_driver_library => "/Users/Ramon/logstash/ojdbc6.jar"
    jdbc_driver_class => "Java::oracle.jdbc.OracleDriver"
    jdbc_connection_string => "jdbc:oracle:thin:@192.168.1.33:1521:test"
    jdbc_user => "system"
    jdbc_password => "password"
    schedule => "* * * * *"
    tracking_column => id
    use_column_value => true
    statement => "select * from users where id  > :sql_last_value"
  }
}
output {
	syslog {
		facility => "local7"
		host => "eu.elb.relay.logtrust.net"	
		port => "443"
		severity => "informational"
		appname => "my.app.oracle.test"		#HERE WE ADD THE TAG
		protocol => "ssl-tcp"
		ssl_cert => "/Users/Ramon/logstash/ca/ramontest.crt"
		ssl_key => "/Users/Ramon/logstash/ca/ramontest.key"
		ssl_cacert => "/Users/Ramon/logstash/ca/chain.crt"
		codec => line {
			format => "%{nombre},%{id}"
            }
        }
		stdout { 
			codec => rubydebug 
		}
}

Have we answered your question?

If not, please contact our technical support team via email by clicking the button below.

CONTACT US