一、创建网络
docker network create -d bridge elastic
# 和elasticsearch使用同一个网络
二、拉取logstash镜像
docker pull logstash:7.1.1
三、创建logstash容器
docker run -it \ --name logstash \ -p 9600:9600 \ -p 5044:5044 \ --net elastic \ logstash:7.1.1
四、修改配置logstash.yml
path.config: /usr/share/logstash/config/logstash.conf path.logs: /var/log/logstash
五、logstash.conf配置
input { tcp { port => 5044 codec => "json" } } output { elasticsearch { hosts => ["http://172.19.0.3:9200"] index => "logstash-%{+YYYY.MM.dd}" } stdout { codec => rubydebug } }
标签:logstash7,7.1,conf,docker,5044,安装,logstash From: https://www.cnblogs.com/fyiyy/p/18396872