Hello,
I am trying to configure logstash with docker compose. Here is my configuration. From the logs, it shows it is bringing up my pipeline but crashes after that. can someone please help what went wrong?
docker-compose:
logstash:
image: docker.elastic.co/logstash/logstash:7.1.1
container_name: Logstash
ports:
- 5033:5033
links:
- es01
volumes:
- /el1/app/elkstack/docker/settings:/usr/share/logstash/config
command: logstash
$ cat pipelines.yml
- pipeline.id: RP
pipeline.workers: 3
pipeline.batch.size: 2
queue.type: persisted
path.config: "/usr/share/logstash/config/logstash.conf"
$ cat logstash.conf
input {
beats {
host => "205.10.10.1"
port =>5033
type => %{log_type}
}
}
filter {
}
output {
if [fields][log_type] == "AMS1" {
elasticsearch {
hosts => ["http://205.10.10.2:9200"]
index => "ams1_log-%{+YYYY.MM.dd}"
}
}
if [fields][log_type] == "tc_log" {
elasticsearch {
hosts => ["http://205.10.10.2:9200"]
index => "tc-%{+YYYY.MM.dd}"
}
}
}
Here is the error message: The port is open only.
[2019-06-26T18:19:35,989][INFO ][logstash.javapipeline ] Pipeline started {"pipeline.id"=>".monitoring-logstash"}
[2019-06-26T18:19:36,041][INFO ][logstash.agent ] Pipelines running {:count=>2, :running_pipelines=>[:RP, :".monitoring-logstash"], :non_running_pipelines=>}
warning: thread "Api Webserver" terminated with exception (report_on_exception is true):
Errno::EADDRNOTAVAIL: Cannot assign requested address - bind - Cannot assign requested address
initialize at org/jruby/ext/socket/RubyTCPServer.java:127
new at org/jruby/RubyIO.java:876
add_tcp_listener at /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/puma-2.16.0-java/lib/puma/binder.rb:234
add_tcp_listener at (eval):2
start_webserver at /usr/share/logstash/logstash-core/lib/logstash/webserver.rb:88
run at /usr/share/logstash/logstash-core/lib/logstash/webserver.rb:44
each at org/jruby/RubyRange.java:511
each_with_index at org/jruby/RubyEnumerable.java:1194
run at /usr/share/logstash/logstash-core/lib/logstash/webserver.rb:39
start_webserver at /usr/share/logstash/logstash-core/lib/logstash/agent.rb:376
[2019-06-26T18:19:36,678][FATAL][logstash.runner ] An unexpected error occurred! {:error=>#<Errno::EADDRNOTAVAIL: Cannot assign requested address - bind - Cannot assign requested address>, :backtrace=>["org/jruby/ext/socket/RubyTCPServer.java:127:in initialize'", "org/jruby/RubyIO.java:876:in
new'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/puma-2.16.0-java/lib/puma/binder.rb:234:in add_tcp_listener'", "(eval):2:in
add_tcp_listener'", "/usr/share/logstash/logstash-core/lib/logstash/webserver.rb:88:in start_webserver'", "/usr/share/logstash/logstash-core/lib/logstash/webserver.rb:44:in
block in run'", "org/jruby/RubyRange.java:511:in each'", "org/jruby/RubyEnumerable.java:1194:in
each_with_index'", "/usr/share/logstash/logstash-core/lib/logstash/webserver.rb:39:in run'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:376:in
block in start_webserver'"]}
[2019-06-26T18:19:36,763][ERROR][org.logstash.Logstash ] java.lang.IllegalStateException: Logstash stopped processing because of an error: (SystemExit) exit