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  :
#   ADAPTER     ADDRESS         CONTAINERS      SOURCES OPTIONS
#   logstash    0.0.0.0:5000                            map[]
2016/11/17 07:15:57 logstash: could not write:write udp 127.0.0.1:34146->127.0.0.1:5000: 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://0.0.0.0:5000 c045f1a3472b

  • install and Run Kurento Media server in Cent OS 6.6 using Docker
  • How to clone and customise laravel homestead and install more things in it?
  • Why do my volumes sometime not get mounted in my Docker container when using fig?
  • Running impala sql script from Docker file
  • Kubernetes on docker creates containers with empty serviceaccount and no tokens leading to container crash and restarts
  • docker build running out of memory, but plenty of memory seems to be available
  • 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=>"0.0.0.0:5000"}
    07:04:12.003 [[main]-pipeline-manager] INFO  logstash.inputs.tcp - Starting tcp input listener {:address=>"0.0.0.0:5000"}
    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.

  • Issue with docker and bundler
  • npm install errors out saying ' Error: getaddrinfo ENOTFOUND npm.lab.myorg.com'
  • How to implement custom health checks for EC2 instances without using an ELB?
  • “tag latest not found” on docker pull with private registry
  • Guidance needed - how to track nginx-docker-rails performance issue
  • Kubernetes UI: error in kubectl proxy
  • 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.