Docker 安装 Logstash
使用同版本镜像 7.4.1
1、下载Logstash镜像
docker pull logstash:7.4.1 #查看镜像 docker images
2、编辑logstash.yml配置文件
logstash.yml配置文件放在宿主机/data/elk/logstash目录下,内容如下:
path.config: /usr/share/logstash/conf.d/*.conf path.logs: /var/log/logstash
3、编辑test.conf文件
test.conf文件放在宿主机/data/elk/logstash/conf.d目录下,内容如下:
input { beats { port => 5044 codec => "json" } } output { elasticsearch { hosts => ["192.168.12.183:9200"] } stdout { codec => rubydebug } }
4、启动logstash
docker run -d --restart=always --log-driver json-file --log-opt max-size=100m --log-opt max-file=2 -p 5044:5044 --name xinyar-logstash -v /data/elk/logstash/logstash.yml:/usr/share/logstash/config/logstash.yml -v /data/elk/logstash/conf.d/:/usr/share/logstash/conf.d/ logstash:7.4.1
5、查看容器运行状态
docker ps docker logs -f xinyar-logstash
相关推荐
goodstudy 2020-08-19
weikaixxxxxx 2020-08-01
liulin0 2020-07-26
AFei00 2020-07-26
娜娜 2020-07-20
偏头痛杨 2020-07-18
winxcoder 2020-07-18
superviser000 2020-06-28
liulin0 2020-06-25
liulin0 2020-06-16
wangfengqingyang 2020-06-11
cullinans 2020-06-09
winxcoder 2020-06-08
citic 2020-06-06
goodstudy 2020-06-05
superviser000 2020-05-30
yuzhongdelei0 2020-05-15
wzhwangzhuohui 2020-05-12
李玉志 2020-05-11