I am trying out the ELK to pipe a tomcat log to ES via Logstash and view it in Kibana. After running "docker-compose up" I can visit ES via http://localhost:9200/_cat/health. Also Kibana via http://localhost:5601. However, Logstash always gives
[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)"}
Here is my docker-compose.yml
version: '3'
services:
elasticsearch:
container_name: elasticsearch
image: docker.elastic.co/elasticsearch/elasticsearch:7.4.1
environment:
- node.name=elasticsearch
- cluster.name=elasticsearch
- bootstrap.memory_lock=true
- discovery.type=single-node
ports:
- "9200:9200"
ulimits:
memlock:
soft: -1
hard: -1
kibana:
container_name: kibana
image: docker.elastic.co/kibana/kibana:7.4.1
ports:
- "5601:5601"
logstash:
container_name: logstash
image: docker.elastic.co/logstash/logstash:7.4.1
volumes:
- ./logstash.conf:/usr/share/logstash/pipeline/logstash.conf
And my logstash.conf
input {
file {
path => "C:\Tomcat\logs\myapp.log"
codec => "json"
type => "logback"
}
}
output {
elasticsearch {
hosts => "localhost:9200"
}
}
Please help