1

I am quite new to logstash but I've been spending quite some time in trying to get this right with no success. I am sending my logs from multiple applications on different server via udp to be logged. Here's the logstash configuration:

input{
  udp{
    port => 5960
    type => "log4net"
  }
}
filter {
  grok {
    match => ["message", "(?m)%{TIMESTAMP_ISO8601:sourceTimestamp}\s*%{WORD:System}\s*%{LOGLEVEL:logLevel}\s*-\s*%{WORD:logger}\s*-\s*%{NOTSPACE:source}\s*%{NOTSPACE:action}\s*%{UUID:transactionId}\s*%{GREEDYDATA:message}"]
  }
}
output {
  elasticsearch {
    protocol => "http"
    host => "[mylocalip]"
    port => "9200"
   }
  stdout { codec => rubydebug }
}

Unfortunately no message is logged. I checked and made sure that the port is available when I start logstash. I also configured properly the firewall to allow udp message via this port. When I tcpdump I can see the udp messages arriving. Additionally I tried another method of input (logs from nginx) and it works ok. What am I doing wrong?
ElasticSearch version-1.4
Logstash version - 1.5 (initially tried also with 1.4)
OS - CentOs 6.5
Java - OpenJDK Runtime Environment (rhel-2.5.5.1.el6_6-x86_64 u79-b14)

4

2 に答える 2

0

ほとんどの場合、送信者へのルートを見逃しています。この場合、次のことが起こります。

  1. Logstash IP/ポートに送信されたパケットを受信します。
  2. これはネットワーク層であるため、tcpdump で確認できます。
  3. 次に、カーネルは送信者に到達しようとします (UDP の場合でも)。
  4. ルートがない場合は失敗するため、UDP パケットがドロップされ、アプリ レベルでは表示されません。
于 2016-04-05T08:18:52.743 に答える