logspout write: connection refused

I am running into an issue with error

# logspout v3.2-dev-custom by gliderlabs
# adapters: raw tcp logstash udp syslog
# options : persist:/mnt/routes
# jobs    : http[]:80 pump routes
# routes  :
#   logstash                            map[]
2016/11/17 07:15:57 logstash: could not write:write udp> write: connection refused 

after i start the adapter as
sudo docker run --name="logspout" --volume=/var/run/docker.sock:/var/run/docker.sock -e ROUTE_URIS=logstash:// c045f1a3472b

  • Data is lost in Mysql docker container after comminting it to a new image?
  • Webpack Incomplete Chunk Encoding in Chrome
  • Connecting to a Remote EJB Module running in Docker
  • ecs-cli compose service up doesn't terminate
  • docker nginx connection refused while connecting to upstream
  • trouble with running e2e on bitbucket pipeline
  • logstash 5.0 docker container is running with the log

    Sending Logstash's logs to /var/log/logstash which is now configured via      log4j2.properties
    07:04:11.987 [[main]-pipeline-manager] INFO  logstash.inputs.tcp -         Automatically switching from json to json_lines codec {:plugin=>"tcp"}
    07:04:11.987 [[main]<udp] INFO  logstash.inputs.udp - Starting UDP listener {:address=>""}
    07:04:12.003 [[main]-pipeline-manager] INFO  logstash.inputs.tcp - Starting tcp input listener {:address=>""}
    07:04:12.409 [[main]-pipeline-manager] INFO  logstash.outputs.elasticsearch - Elasticsearch pool URLs updated {:changes=>{:removed=>[], :added=>  ["https://~hidden~:~hidden~@fc4fba7c82d6102f5c1a224f0e9f2e9a.us-east-1.aws.found.io:9243"]}}
    07:04:12.410 [[main]-pipeline-manager] INFO  logstash.outputs.elasticsearch - Using mapping template from {:path=>nil}
    07:04:13.612 [[main]-pipeline-manager] INFO  logstash.outputs.elasticsearch - Attempting to install template {:manage_template=>{"template"=>"logstash-*",  "version"=>50001, "settings"=>{"index.refresh_interval"=>"5s"}, "mappings"=>{"_default_"=>{"_all"=>{"enabled"=>true, "norms"=>false}, "dynamic_templates"=>[{"message_field"=>{"path_match"=>"message", "match_mapping_type"=>"string", "mapping"=>{"type"=>"text", "norms"=>false}}}, {"string_fields"=>{"match"=>"*", "match_mapping_type"=>"string", "mapping"=>{"type"=>"text", "norms"=>false, "fields"=>{"keyword"=>{"type"=>"keyword"}}}}}], "properties"=>{"@timestamp"=>{"type"=>"date", "include_in_all"=>false}, "@version"=>{"type"=>"keyword", "include_in_all"=>false}, "geoip"=>{"dynamic"=>true, "properties"=>{"ip"=>{"type"=>"ip"}, "location"=>{"type"=>"geo_point"}, "latitude"=>{"type"=>"half_float"}, "longitude"=>{"type"=>"half_float"}}}}}}}}
    07:04:13.705 [[main]-pipeline-manager] INFO  logstash.outputs.elasticsearch - New Elasticsearch output {:class=>"LogStash::Outputs::ElasticSearch", :hosts=>["fc4fba7c82d6102f5c1a224f0e9f2e9a.us-east-1.aws.found.io:9243"]}
    07:04:13.710 [[main]-pipeline-manager] INFO  logstash.pipeline - Starting pipeline {"id"=>"main", "pipeline.workers"=>1, "pipeline.batch.size"=>125, "pipeline.batch.delay"=>5, "pipeline.max_inflight"=>125}
    07:04:13.717 [[main]-pipeline-manager] INFO  logstash.pipeline - Pipeline main started
    07:04:13.802 [Api Webserver] INFO  logstash.agent - Successfully started     Logstash API endpoint {:port=>9600}

    I am trying to send my individual docker container logs to the elastic cloud using logspout and logstash where logstash, nginx , web etc are on the ec2 instance. Thanks for the help.

  • php-fpm child process exited on signal 11
  • Docker automated build from private bitbucket repo: Failed to clone repository
  • When Docker image push on my linux machine unauthorized: authentication required error display
  • enable gzip compression for Apache running in docker container
  • pass parameters to docker entrypoint
  • Apache Kafka / How to rolling upgrade to with docker
  • One Solution collect form web for “logspout write: connection refused”

    I had this same exact issue when running logstash and logspout in separate containers. In my case, logspout was trying to write to logstash before logstash was ready and this caused the logspout container to error and then crash. It was resolved by adding the RETRY_SEND environment variable to the logspout service in the docker-compose file.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.