我在运行logstash时遇到了问题。我的conf看起来像这样:
input {
udp {
port => 1514
type => docker
}
}
filter {
grok {
match => {
"message" => "<%{NUMBER}>%{DATA}(?:\s+)%{DATA:hostname}(?:\s+)%{DATA:imageName}(?:\s+)%{DATA:containerName}(?:\s*\[%{NUMBER}\]:) (\s+(?<logDate>%{YEAR}-%{MONTHNUM}-%{MONTHDAY}\s+%{HOUR}:%{MINUTE}:%{SECOND}) %{LOGLEVEL:logLevel}(?:\s*);* %{DATA:logAdditionalInfo};*)?%{GREEDYDATA:logMsg}"
}
keep_empty_captures => false
remove_field => ["message"]
}
}
output {
if [type] == "gelf" {
elasticsearch {
index => "phpteam-%{+YYYY.MM.dd}"
}
} else {
elasticsearch { }
}
}
配置正确,但运行后/var/log/logstash/logstash.log显示以下输出:
{:timestamp =&gt;&#34; 2016-06-22T11:43:03.105000 + 0200&#34;,:message =&gt;&#34; SIGTERM 接收。关闭管道。&#34;,:level =&gt;:warn} {:timestamp =&gt;&#34; 2016-06-22T11:43:03.532000 + 0200&#34;,:message =&gt;&#34; UDP 听众死了&#34;,:exception =&gt;#, :backtrace =&gt; [&#34; org / jruby / RubyIO.java:3682:in
select'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-udp-2.0.3/lib/logstash/inputs/udp.rb:77:in
udp_listener&#39;&#34;, &#34; /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-udp-2.0.3/lib/logstash/inputs/udp.rb:50:在run'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.1.1-java/lib/logstash/pipeline.rb:206:in
inputworker&#39;&#34 ;, &#34; /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.1.1-java/lib/logstash/pipeline.rb:199:在 `start_input&#39;&#34;],:level =&gt;:warn}
我发现解决此错误的唯一方法是编辑这些.rb文件,但遗憾的是我不知道该怎么做。你能以某种方式帮助我吗?
提前致谢。
答案 0 :(得分:0)
我发现解决方案并不完美,但有效,所以也许它会帮助某人。
在新服务器上安装整个实例后,一切正常。
在升级logstash / elasticsearch / kibana之后一切都崩溃了,所以可能配置文件出了问题,但我找不到哪些。