注意:jdbc.conf和jdbc.sql文件编码都为ANSI

 

jdbc.conf内容如下:

 

input {
    stdin {
    }
    jdbc {      
      jdbc_connection_string => "jdbc:sqlserver://172.19.148.63:1433;databaseName=EB_Search"   
      jdbc_user => "sa"
      jdbc_password => "123@abcd"    
      jdbc_driver_library => "D:\Software\ELK5.5.0\logstash-5.5.0\bin\mssql\sqljdbc4-2.0.jar"     
      jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver"  
      statement_filepath => "D:\Software\ELK5.5.0\logstash-5.5.0\bin\mssql\jdbc.sql"
      schedule => "* * * * *"     
    }
}
output {
    elasticsearch {
        hosts => "10.0.10.143:9200"
        index => "sync_productinfo"		
    }
}

 

  

 

jdbc.sql内容如下:

SELECT TOP 1000 * FROM [ProductInfo] ORDER BY CreateTime DESC

启动命令:

 

cd D:\Software\ELK5.5.0\logstash-5.5.0\bin
.\logstash.bat -f  .\mssql\jdbc.conf

 

  

 

相关文章:

  • 2021-05-08
  • 2021-08-12
  • 2021-09-22
  • 2021-05-20
  • 2021-11-28
猜你喜欢
  • 2021-12-24
  • 2021-05-09
  • 2021-12-12
  • 2021-12-06
  • 2021-12-22
相关资源
相似解决方案