從github上下載useJavatoOpenFile https://github.com/edwinf/ruby-filewatch/tree/useJavatoOpenFile
wget https://github.com/jordansissel/ruby-filewatch/archive/master.zip
以上二選一
1.找到JRubyFileExtension.jar 並把他複製到1.4.2 LOGSTASH_HOME/vendor/bundle/jruby/2.1/gems/filewatch-0.5.1/lib同級目錄下
2.將filewatch 文件夾完全複製到1.4.2 LOGSTASH_HOME/vendor/bundle/jruby/2.1/gems/filewatch-0.5.1/lib,2.1爲版本號,爲了穩定,如有多個版本,都給他複製了.讀取jar文件是在tail.rb的第10行
這時應該沒問題了.
3.如果有問題可以嘗試設置 set CloseAfterRead=true
reference:http://stackoverflow.com/questions/20592142/logstash-elasticsearch-reloads-the-same-data/28523646#28523646
reference2:http://blog.csdn.net/xiaohelong2005/article/details/43833939