-
下载Logstash7.17.3的docker镜像:
docker pull logstash:7.17.3
-
修改Logstash的配置文件logstash.conf中output节点下的Elasticsearch连接地址为es:9200,配置文件地址:https://github.com/macrozheng/mall/blob/master/document/elk/logstash.conf
output { elasticsearch { hosts => "es:9200" index => "mall-%{type}-%{+YYYY.MM.dd}" } }
或者直接使用我的文件(记得ip换成你自己的) : https://shaun.lanzoum.com/iYxoV10uqlsh
-
创建/mydata/logstash目录,并将Logstash的配置文件logstash.conf拷贝到该目录;
mkdir /mydata/logstash
-
使用如下命令启动Logstash服务;
docker run --name logstash -p 4560:4560 -p 4561:4561 -p 4562:4562 -p 4563:4563 \ --link elasticsearch:es \ -v /mydata/logstash/logstash.conf:/usr/share/logstash/pipeline/logstash.conf \ -d logstash:7.17.3
-
进入容器内部,安装json_lines插件。
docker exec -it logstash bash
logstash-plugin install logstash-codec-json_lines
标签:logstash,配置文件,Logstash,conf,docker,安装,Docker,es From: https://www.cnblogs.com/shaun88/p/17516940.html