Unable to start logstash using docker compose


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?


image: docker.elastic.co/logstash/logstash:7.1.1
container_name: Logstash
- 5033:5033
- es01
- /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 => ""
port =>5033

type => %{log_type}


filter {
output {
if [fields][log_type] == "AMS1" {
elasticsearch {

            hosts => [""]
            index => "ams1_log-%{+YYYY.MM.dd}"
  if [fields][log_type] == "tc_log" {
    elasticsearch {
            hosts => [""]
            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:innew'", "/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:inadd_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:inblock in run'", "org/jruby/RubyRange.java:511:in each'", "org/jruby/RubyEnumerable.java:1194:ineach_with_index'", "/usr/share/logstash/logstash-core/lib/logstash/webserver.rb:39:in run'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:376:inblock 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

I believe the monitoring web server binds to by default. You can set http.host in logstash.yml to change that.

Thanks Badger! I found the issue with logstash.yml as I defined http.host as my logstash host. it is not required. I kept logstash.yml empty(it needs this empty file. otherwise it is throwing error). After this it worked fine.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.