Logstash with docker

This error appears when I run the kibana docker-compose, elastisearch, logstash

logstash | [2020-03-06T18:41:21,278][WARN ][logstash.outputs.elasticsearch] Attempted to resurrect connection to dead ES instance, but got an error. {:url=>"http://localhost:9200/", :error_type=>LogStash::Outputs::ElasticSearch::HttpClient::Pool::HostUnreachableError, :error=>"Elasticsearch Unreachable: [http://localhost:9200/][Manticore::SocketException] Connection refused (Connection refused)"}

the docker-compose is

version: '2.2'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.5.1
container_name: elasticsearch
environment:
- cluster.name=es-docker-cluster
- discovery.type=single-node
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- data01:/usr/share/elasticsearch/data
ports:
- 9200:9200
- 9300:9300
networks:
- elasticstack

kibana:
image: docker.elastic.co/kibana/kibana:7.5.1
container_name: kibana
ports:
- 5601:5601
environment:
ELASTICSEARCH_URL: http://elasticsearch:9200
ELASTICSEARCH_HOSTS: http://elasticsearch:9200
networks:
- elasticstack

logstash:
image: docker.elastic.co/logstash/logstash:7.5.1
container_name: logstash
volumes:
- /home/alex/Escritorio/prueba_docker/pipeline:/usr/share/logstash/pipeline/
command: logstash -f /usr/share/logstash/pipeline/
#environment:
# ELASTICSEARCH_URL: http://elasticsearch:9200
# ELASTICSEARCH_HOSTS: http://elasticsearch:9200
# - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
links:
- elasticsearch:elasticsearch
#depends_on:
# - elasticsearch
networks:
- elasticstack

volumes:
data01:
driver: local

networks:
elasticstack:
driver: bridge

and the logtash configuration file is

input {
stdin {
}
}

output {
elasticsearch {
hosts => ["http://localhost:9200"]
}
stdout {
codec => rubydebug
}
}

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