【原創】大數據基礎之Logstash(3)應用之http(in和out)

一個logstash很容易經過http打斷成兩個logstash實現跨服務器或者跨平臺間數據同步,好比原來的流程是html

logstash: nginx log -> kafkanginx

打斷成兩個是json

logstash1: nginx log -> http outruby

logstash2: http in ->kafka服務器

具體以下app

http out

 
 

  filter {
    ruby {
      code => "event.cancel if not event.get('message').include?'something'"
    }
  }ide

output { http { url => "http://test.server:10000" codec => "plain" format => "json" content_type => "application/json" http_method => "post" } }

能夠經過filter跳過不須要的記錄post

http in

input { http { host => "0.0.0.0" port => 10000 additional_codecs => {"application/json"=>"json"} codec => "plain" threads => 4 ssl => false } }

 

http inui

參考:https://www.elastic.co/guide/en/logstash/current/plugins-inputs-http.htmlurl

http out

參考:https://www.elastic.co/guide/en/logstash/current/plugins-outputs-http.html

相關文章
相關標籤/搜索