output模組外掛的詳細介紹
阿新 • • 發佈:2020-08-13
elaticserach外掛
- 常用引數說明:
- hosts:設elasticsearch的ip和埠
- 支援的格式:埠和http加不加都可以
- 如下格式都可以:
- hosts=>"192.168.57.100"
- hosts=>"192.168.57.100:9200"
- hosts=>"http://192.168.57.100"
- hosts=>["http://192.168.57.100:9200"]
- hosts=>["http://192.168.57.100:9200","http://192.168.57.110:9200"]
- 注意點:為了避免向主節點推送批量操作的請求,url只需要配置data node 和 client node
- index:事件最終要寫入的目標索引
- document_type:文件名稱,資料寫入該文件下面(在7.X以上版本不建議使用,8.X版本已經移除)
- document_id :設定資料在ES儲存時候的id,如果不設定ES會自動生成id(如果input為MySQL,則可以引用MySQL中的欄位作為id)
- hosts:設elasticsearch的ip和埠
- 其他引數說明:
- 例項:
output { elasticsearch { #es的ip和埠 hosts => ["http://192.168.227.100:9200"] #ES索引名稱(自己定義的) index => "mdl_001_202001" #文件型別 document_type => "MdL_001" #設定資料的id為資料庫中的欄位 document_id => "%{trans_jnls_no}" } }