Docker Compose – Logstash – uscito dal codice 0 dopo l'avvio

Sto cercando di utilizzare Logstash con Docker Compose, il file .yml è simile a questo:

user-service: image: images/user-service ports: - "2222:2222" links: - logstash logstash: image: images/logstash command: logstash -e 'input{} output{}' ports: - "5045:5045" 

E logstash inizia e termina, come mostra la console:

 logstash_1 | Sending Logstash's logs to /var/log/logstash which is now configured via log4j2.properties logstash_1 | 01:51:30.164 [[main]-pipeline-manager] INFO logstash.pipeline - Starting pipeline {"id"=>"main", "pipeline.workers"=>2, "pipeline.batch.size"=>125, "pipeline.batch.delay"=>5, "pipeline.max_inflight"=>250} logstash_1 | 01:51:30.246 [[main]-pipeline-manager] INFO logstash.pipeline - Pipeline main started logstash_1 | 01:51:30.860 [Api Webserver] INFO logstash.agent - Successfully started Logstash API endpoint {:port=>9600} logstash_1 | 01:51:33.318 [LogStash::Runner] WARN logstash.agent - stopping pipeline {:id=>"main"} docker_logstash_1 exited with code 0 

Quale potrebbe essere il problema?

Ho risolto la modifica dell'ingresso dal filter:

 input{ tcp{ port=> 9600 host=>localhost } }