Niru

Logstash query

Jan 10th, 2018
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 0.84 KB | None | 0 0
  1. input {
  2.    
  3.   jdbc {
  4.         jdbc_driver_library => "D:/Portal/logstash-6.1.1/lib/sqljdbc4.jar"
  5.         jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver"
  6.         jdbc_connection_string => "jdbc:sqlserver://myservername:1433;DatabaseName=mydbnme"
  7.         jdbc_user => "*******"
  8.         jdbc_password => "*******"
  9.         statement => "SELECT * FROM dbo.ParentSummaryWidgetData_ES_UPGRADE"
  10.         lowercase_column_names => "false"
  11.         add_field => {"[@metadata][index_name]" => "parent_measure_code"}
  12.   }
  13.  
  14. }
  15.  
  16. filter {
  17.  
  18. }
  19.  
  20. output {
  21. if [@metadata][index_name] == "parent_measure_code" {
  22.         elasticsearch {
  23.         template => "parent_measure_code_template.txt"
  24.         template_name => "parent_measure_code"
  25.         action => "index"
  26.         hosts  => ["localhost:9201"]
  27.         index  => "parent_measure_code"
  28.         document_id => "%{id}"
  29.         workers => 1
  30.     }
  31.         stdout { codec => rubydebug }
  32. }
  33. }
Add Comment
Please, Sign In to add comment