Docker Compose - Logstash - exited with code 0 after start
<p>I'm trying to use Logstash with Docker Compose, the .yml file looks like this:</p>

<pre><code>user-service:
image: images/user-service
ports:
  - "2222:2222"
links:
 - logstash

logstash:
image: images/logstash
command: logstash -e 'input{} output{}'
ports:
  - "5045:5045"
</code></pre>

<p>And logstash starts and ends, as the console shows:</p>

<pre><code>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"=&gt;"main", "pipeline.workers"=&gt;2, "pipeline.batch.size"=&gt;125, "pipeline.batch.delay"=&gt;5, "pipeline.max_inflight"=&gt;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=&gt;9600}
logstash_1          | 01:51:33.318 [LogStash::Runner] WARN  logstash.agent - stopping pipeline {:id=&gt;"main"}
docker_logstash_1 exited with code 0
</code></pre>

<p>What could be the problem?</p>