Logstash SQL Server Data Import

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

input {
  jdbc         


        
3条回答
  •  感情败类
    2020-12-14 12:33

    Do it like this:-

    input {
      jdbc {
        jdbc_driver_library => "sqljdbc4.jar"
        jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver"
        jdbc_connection_string => "jdbc:sqlserver://192.168.2.126:1433;databaseName=test
        jdbc_password => "sa@sa2015"
        schedule => "0 0-59 0-23 * * *"
        statement => "SELECT ID , Name, City, State,ShopName FROM dbo.Shops"
        jdbc_paging_enabled => "true"
        jdbc_page_size => "50000"
      }
    }
    filter {
    }
    output {
      stdout { codec => rubydebug }
        elasticsearch { 
            protocol => "http"
            index => "shops"
            document_id => "%{id}"
            hosts => "your_host_here"
    
        }
    }
    

提交回复
热议问题