Logstash 是一个用于日志收集、处理、转发的软件,对应 input/filter/output 三个阶段,能够配置多个插件实现流式处理javascript
咱们能够自定义开发插件,实现丰富的日志处理功能java
参考文档 www.elastic.co/products/lo…linux
PATH=$PATH:/path/to/jruby-version/bin/复制代码
jruby 9.1.6.0 (2.3.1) 2016-11-09 0150a76 Java HotSpot(TM) 64-Bit Server VM 25.45-b02 on 1.8.0_45-b14 +jit [linux-x86_64]复制代码
/path/to/jruby-veriosn/bin/jgem install bundler复制代码
bundle config mirror.https://rubygems.org https://gems.ruby-china.org复制代码
换成国内的下载源后,能够加速依赖安装过程,参考文档 gems.ruby-china.org/ios
/path/to/logstash-version/bin/logstash-plugin generate --type input --name demo --path /path/to/plugins复制代码
cd /path/to/plugins/logstash-input-demo复制代码
修改 logstash-input-demo.gemspec 文件中 TODO 相关的内容,而后执行安装依赖:ruby
bundle install复制代码
bundle exec rspec复制代码
参考文档 [rspec.info/](http://rs…微信
/path/to/jruby-veriosn/bin/gem build {logstash-filter-example}.gemspec复制代码
/path/to/logstash-version/bin/logstash-plugin install /path/to/gemfile复制代码
/path/to/logstash-version/bin/logstash-plugin list复制代码
若是你的插件成功安装,那么就能够在 Logstash 的配置文件中引用了svg
(还有疑问?联系做者微博/微信 @Ceelog)测试