Sql server JDBC MSSQL与Logsatsh连接到监控数据库

Sql server JDBC MSSQL与Logsatsh连接到监控数据库,sql-server,jdbc,logstash,elastic-stack,mssql-jdbc,Sql Server,Jdbc,Logstash,Elastic Stack,Mssql Jdbc,我已经安装了Logsatsh7.2,我正在尝试配置从Solarwinds数据库获取数据。 我正在使用以下日志存储配置: input { jdbc { jdbc_connection_string => "jdbc:sqlserver://SOLARWINS:5674;databasename=Orion_DB;integratedSecurity=true" jdbc_driver_class => "com.microsoft.sq

我已经安装了Logsatsh7.2,我正在尝试配置从Solarwinds数据库获取数据。 我正在使用以下日志存储配置:

    input {
    jdbc {
        jdbc_connection_string => "jdbc:sqlserver://SOLARWINS:5674;databasename=Orion_DB;integratedSecurity=true"
        jdbc_driver_class =>  "com.microsoft.sqlserver.jdbc.SQLServerDriver"
        jdbc_driver_library => "/etc/logstash/mssql-jdbc-7.4.1.jre8.jar"
        jdbc_user => "logstash"
        jdbc_password => "pass123"
        statement => "SELECT * from events"
    }
}
output {
          elasticsearch { hosts => ["10.26.67.29:9200"]
                index => "swdata"
          }
          stdout { codec => rubydebug }
       }
我得到一个错误,上面写着:

[2020-01-08T01:57:19,264][ERROR][logstash.inputs.jdbc     ] Unable to connect to database. Tried 1 times {:error_message=>"Java::ComMicrosoftSqlserverJdbc::SQLServerException: This driver is not configured for integrated authentication. ClientConnectionId:ef93944c-9f83-44d3-a370-254903b671ef"}
[2020-01-08T01:57:19,265][ERROR][logstash.javapipeline    ] A plugin had an unrecoverable error. Will restart this plugin.
  Pipeline_id:sw
  Plugin: <LogStash::Inputs::Jdbc jdbc_user=>"sa_logstash", jdbc_password=><password>, statement=>"SELECT * from events", jdbc_driver_library=>"/etc/logstash/mssql-jdbc-7.4.1.jre8.jar", jdbc_connection_string=>"jdbc:sqlserver://SOLARWINS:5674;databasename=Orion_DB;integratedSecurity=true", id=>"3c6c347831ec1a9a964da106925ef193a86d1d52adf190f9bd046d6b408e3e2b", jdbc_driver_class=>"com.microsoft.sqlserver.jdbc.SQLServerDriver", enable_metric=>true, codec=><LogStash::Codecs::Plain id=>"plain_52f36adf-96b9-44a1-8e8c-40b2f009ebd2", enable_metric=>true, charset=>"UTF-8">, jdbc_paging_enabled=>false, jdbc_page_size=>100000, jdbc_validate_connection=>false, jdbc_validation_timeout=>3600, jdbc_pool_timeout=>5, sql_log_level=>"info", connection_retry_attempts=>1, connection_retry_attempts_wait_time=>0.5, parameters=>{"sql_last_value"=>2020-01-07 12:18:53 UTC}, last_run_metadata_path=>"/usr/share/logstash/.logstash_jdbc_last_run", use_column_value=>false, tracking_column_type=>"numeric", clean_run=>false, record_last_run=>true, lowercase_column_names=>true>
  Error: Java::ComMicrosoftSqlserverJdbc::SQLServerException: This driver is not configured for integrated authentication. ClientConnectionId:ef93944c-9f83-44d3-a370-254903b671ef
  Exception: Sequel::DatabaseConnectionError
新的错误日志:

[2020-01-08T04:36:56,186][ERROR][logstash.inputs.jdbc     ] Unable to connect to database. Tried 1 times 
{:error_message=>"Java::ComMicrosoftSqlserverJdbc::SQLServerException: Integrated authentication failed. ClientConnectionId:dd8a0cae-cbc1-4a8b-94aa-a3186e810e94"}
    [2020-01-08T04:36:56,189][ERROR][logstash.javapipeline    ] ntAuthInit(com/microsoft/sqlserver/jdbc/KerbAuthentication.java:125)

根据JDBCSQL连接文档,您可以尝试提供用户名和密码吗 连接字符串查询中的密码,如下所示:

jdbc:sqlserver://servername=server_name;integratedSecurity=true;authenticationScheme=JavaKerberos;userName=****;password=****

Please refer the doc :


这个问题仍然存在。但是,我将integratedsecurity设置为false,以便只允许SQL身份验证,而不允许windows/Kerberos级别的身份验证。
jdbc:sqlserver://servername=server_name;integratedSecurity=true;authenticationScheme=JavaKerberos;userName=****;password=****

Please refer the doc :
please try and let me know , if the issue still persists.

Thanks.