logstash-plugins / logstash-input-gelf

Apache License 2.0
20 stars 39 forks source link

gelf input accepts connection from localhost but not from ip #16

Open suyograo opened 9 years ago

suyograo commented 9 years ago

From https://github.com/elastic/logstash/issues/3666

Logstash Input Configuration

input {
  gelf {}
}

Telnet Test

[root@localhost ~]# telnet localhost 12201
Trying ::1...
Connected to localhost.
Escape character is '^]'.
Connection closed by foreign host.
[root@localhost ~]# telnet 192.168.1.149 12201
Trying 192.168.1.149...
telnet: connect to address 192.168.1.149: Connection refused
dlcampbell888 commented 9 years ago

Er, nevermind. Telnet is TCP, the gelf input is UDP. You can test like this:

echo -e '{"version": "1.1","host":"example.org","short_message":"Short message","full_message":"Backtrace here\n\nmore stuff","level":1,"_user_id":9001,"_some_info":"foo","_some_env_var":"bar"}\0' | nc -v -u 12201

I had to put -Djava.net.preferIPv4Stack=true in the java opts to get it to bind to an IPv4 port.

But even still, the GELF input is not working very well for me. I think there are some bugs in the current version. It would be really nice to have it because we want to use the GELF appender for jboss logs.