When I was trying ELK I install the logstash-2.4.0. And I wrote the log4j_to_es.conf
. When I run ./bin/logstash agent -f config/log4j_to_es.conf
I got an error.
Settings: Default pipeline workers: 4
Pipeline aborted due to error {:exception=>"Errno::EADDRNOTAVAIL", :backtrace=>[
"org/jruby/ext/socket/RubyTCPServer.java:118:in `initialize'",
"org/jruby/RubyIO.java:871:in `new'",
"/home/tools/logstash-2.4.0/vendor/bundle/jruby/1.9/gems/logstash-input-log4j-2.0.7-java/lib/logstash/inputs/log4j.rb:71:in `register'",
"/home/tools/logstash-2.4.0/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0-java/lib/logstash/pipeline.rb:330:in `start_inputs'",
"org/jruby/RubyArray.java:1613:in `each'",
"/home/tools/logstash-2.4.0/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0-java/lib/logstash/pipeline.rb:329:in `start_inputs'",
"/home/tools/logstash-2.4.0/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0-java/lib/logstash/pipeline.rb:180:in `start_workers'",
"/home/tools/logstash-2.4.0/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0-java/lib/logstash/pipeline.rb:136:in `run'",
"/home/tools/logstash-2.4.0/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0-java/lib/logstash/agent.rb:491:in `start_pipeline'"],
:level=>:error}
stopping pipeline {:id=>"main"}
And the log4j_to_es.conf
is like this:
input {
log4j {
mode => "server"
host => "120.13.243.95"
port => 4567
}
}
output {
elasticsearch {
action => "index"
hosts => "192.168.1.54:9200"
index => "applog"
}
}
The system is CentOS 7.2.1511. The input is another server. output is localhost.