input {
jdbc
input {
jdbc {
jdbc_driver_library => "C:\Program Files\Microsoft JDBC Driver 6.0 for SQL Server\sqljdbc_6.0\enu\jre8\sqljdbc42.jar"
jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver"
jdbc_connection_string => "jdbc:sqlserver://[SERVER NAME];databaseName=[DATABASE NAME];"
jdbc_user => "[USERNAME]"
jdbc_password => "[PASSWORD]"
statement => "SELECT eventId, sessionId FROM Events;"
}
}
output {
elasticsearch {
hosts => "http://localhost:9200"
index => "events3"
}
stdout { codec => rubydebug }
}
You need to download sqljdbc drivers from https://www.microsoft.com/en-au/download/details.aspx?id=11774 and wherever you will unzip those drivers just give that path in jdbc_driver_library. Try to unzip those drivers into same path as shown in code.