docker安装logstash
作者:互联网
1、拉取镜像
docker pull logstash:8.2.0
2、启动服务
#将宿主机的520端口映射到容器的514端口 docker run -d --name=logstash -p 520:514 logstash:8.2.0
3、拷贝容器的配置文件出来
# 从容器里面拷贝文件/目录到本地一个路径 $docker cp Name:/container_path to_path $docker cp ID:/container_path to_path #在这里进入logstash获取到config路径是 /usr/share/logstash/config docker cp logstash:/usr/share/logstash/config /Users/xuweiqiang/Documents/logstash
4、更改配置logstash开启syslog端口并将日志输出到stdout
vim logstash.yml path.config: /usr/share/logstash/config/conf.d/*.conf mkdir conf touch syslog.conf
配置
input { syslog { port => "514" } } output { stdout { } }
5、将本地改好的配置映射到容器之中
docker run -d --name=logstash -p 520:514 -v /Users/xuweiqiang/Documents/logstash/config:/usr/share/logstash/config logstash:8.2.0
TRANSLATE with x English TRANSLATE with COPY THE URL BELOW Back EMBED THE SNIPPET BELOW IN YOUR SITE Enable collaborative features and customize widget: Bing Webmaster Portal Back
标签:安装,logstash,usr,path,docker,config,514 来源: https://www.cnblogs.com/xuweiqiang/p/16279275.html