问题
I'm trying to connect logstash (Version 1.5.0) to get logs of services (that run on apache-tomcat). These logs are log4j.
I use this config for logstash:
input {
log4j {
mode => server
host => localhost
port => 4560
type => "log4j"
}
}...
and in my service' log4j.xml I've set my SocketAppender:
<appender name="OHADS" class="org.apache.log4j.net.SocketAppender">
<param name="port" value="4560" />
<param name="remoteHost" value="localhost" />
</appender>
It works fine.
The questions:
- I want logstash to collect logs not from my 'localhost', but from other tomcats, from other machines, as well. How can I do that? when I tried to put in the "host" (in logstash config) something other than localhost (or the IP of the local machine), i got error on startup:
"Cannot assign requested address - bind - Cannot assign requested address".
- How can I connect it to several IPs simultanously?
any ideas?
来源:https://stackoverflow.com/questions/30624467/connect-logstash-1-5-0-with-log4j-of-several-servers