我想連接到數據庫從sql提取數據與logstash;我的服務器名稱是WIN-07LLQEN2SJB \ SQLEXPRESS。當我運行logstash配置文件時,它會返回數據庫連接錯誤。想問問任何人是否有想法。非常感謝提前。與Logstash數據庫連接錯誤
input {
jdbc {
jdbc_driver_library => "C:\Users\Administrator\Downloads\Microsoft JDBC Driver 4.2 for SQL Server\sqljdbc_4.2\enu\sqljdbc42.jar"
jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver"
jdbc_connection_string => "jdbc:sqlserver://localhost:1433/WIN-07LLQEN2SJB\SQLEXPRESS;user=sa;password=*****"
jdbc_user => "sa"
jdbc_password => "*****"
schedule => "* * * * *"
statement => "SELECT database_id, name, data_used_size, log_used_size FROM DISK.dbo.disk_activity"
jdbc_paging_enabled => "true"
jdbc_page_size => "50000"
}
}
filter {
}
output {
stdout {
codec => rubydebug
}
elasticsearch_http {
host => "localhost"
index => "sql"
}
}
什麼是你的數據庫運行在主機名和端口? – Val
主機名稱應爲WIN-07LLQEN2SJB,端口應爲1433,默認值爲。我試圖關閉防火牆。 –