一個logstash很容易經過http打斷成兩個logstash實現跨服務器或者跨平臺間數據同步,好比原來的流程是html
logstash: nginx log -> kafkanginx
打斷成兩個是json
logstash1: nginx log -> http outruby
logstash2: http in ->kafka服務器
具體以下app
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
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