我试图将Logstash与Docker Compose一起使用,.yml文件如下所示:
user-service:
image: images/user-service
ports:
- "2222:2222"
links:
- logstash
logstash:
image: images/logstash
command: logstash -e 'input{} output{}'
ports:
- "5045:5045"
logstash开始和结束,控制台显示:
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
可能是什么问题?
答案 0 :(得分:0)
我决定改变过滤器的输入:
input{ tcp{
port=> 9600
host=>localhost
}
}