Logstash SQL Server Data Import

后端 未结 3 467
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-14 11:57

input {
  jdbc         


        
3条回答
  •  无人及你
    2020-12-14 12:25

    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.

提交回复
热议问题