Logstash Oracle鍚屾璁剧疆

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Logstash Oracle鍚屾璁剧疆相关的知识,希望对你有一定的参考价值。

鏍囩锛?a href='http://www.mamicode.com/so/1/nec' title='nec'>nec   鍙橀噺   鎬濇兂   and   use   user   driver   localtime   椹卞姩   

input {

  jdbc {
    #jdbc椹卞姩鍖呬綅缃?    jdbc_driver_library => "D:	oolselklogstash-7.6.1ojdbc8-12.2.0.1.jar"
    #jdbc椹卞姩绫?    jdbc_driver_class => "Java::oracle.jdbc.driver.OracleDriver"
    # 鏁版嵁搴撶浉鍏抽厤缃?    jdbc_connection_string => "jdbc:oracle:thin:callcard/huawei123@//callcardsitoracle01.beta.hic.cloud:1521/callcardsit_srv"
    jdbc_user => "callcard"
    jdbc_password => "huawei123"
    # 鏄惁娓呴櫎sql_last_value鐨勮褰曪紝闇€瑕佸閲忓悓姝ユ椂姝ゅ瓧娈靛繀椤讳负false锛?    clean_run => true
    # 鍚屾棰戠巼(鍒?鏃?澶?鏈?骞?锛岄粯璁ゆ瘡鍒嗛挓鍚屾涓€娆★紱
    schedule => "*/10 * * * * *"

    use_column_value => true
    tracking_column_type => timestamp
    tracking_column => updated_at

    # 鍚屾SQL
    statement =>"select *
from user n
       
where updated_at>:sql_last_value and updated_at<sysdate order by updated_at desc"
    # 绱㈠紩绫诲瀷锛屼笉闇€瑕佹寚瀹歵ype锛屽惁鍒欎細鍦ㄥ悓姝S鍚庣敓鎴恡ype瀛楁
    #type => "user"
    # 璁剧疆鏃跺尯
    #jdbc_default_timezone =>"Asia/Shanghai"
  }

}
 
filter {
 # 鍒犻櫎鏃犵敤瀛楁
  mutate {   
          remove_field => "@timestamp"
          remove_field => "@version"
  }     

  # 鏃堕棿+8涓椂鍖?鎬濇兂鏄壘涓存椂鍙橀噺锛屾渶鍚?8鍚庢浛鎹?  ruby {
        code => "event.set(鈥楡created_at鈥? event.get(鈥榗reated_at鈥?.time.localtime + 8*60*60)"
  }       
  ruby {   
        code => "event.set(鈥榗reated_at鈥?event.get(鈥楡created_at鈥?)"
  }       
  mutate { 
          remove_field => ["@created_at"]
  }
}
output {
  stdout {
    codec => rubydebug
  }
  #if [type]=="user" {
    elasticsearch {
      # ES host:port
      hosts => ["127.0.0.1:9200"]
      #灏唌ysql鏁版嵁鍔犲叆blog绱㈠紩涓嬶紝浼氳嚜鍔ㄥ垱寤?      index => "user"
      # 鑷ID 闇€瑕佸叧鑱旂殑鏁版嵁搴撲腑鏈夋湁涓€涓猧d瀛楁锛屽搴旂储寮曠殑id鍙穇id
      document_id => "%{id}"
    }
 # }
 
}

以上是关于Logstash Oracle鍚屾璁剧疆的主要内容,如果未能解决你的问题,请参考以下文章

java璁剧疆鐜鍙橀噺

ul涓殑li璁剧疆绛夊楂榗ss

jellin docker 缇ゆ櫀璁剧疆鏂规硶杞嚜鍏堢敓

mysql8.0.11瀹夎銆佸惎鍔ㄤ笌鍩烘湰璁剧疆

flutter 涓婚〉闈㈠簳閮ㄥ鑸爮瀹炵幇浠ュ強涓婚椋庢牸璁剧疆

Help-IntelliJIDEA-2019-鍩虹璁剧疆锛?. 鍏ㄥ眬JDK锛堥粯璁ら厤缃級