赞
踩
docker run --name logstash -d -p 5044:5044 -p 9600:9600 -p 9011-9014:9011-9014 -v /mydata/logstash/config:/usr/share/logstash/config \
-v /mydata/logstash/pipeline:/usr/share/logstash/pipeline \
-v /mydata/nginx/logs:/usr/share/logstash/nginxlog \
logstash:7.0.0
挂载宿主nginx 日志目录到 logstash 容器访问
-v /mydata/nginx/logs:/usr/share/logstash/nginxlog \
input {
file {
path => "/usr/share/logstash/nginxlog/access.log"
type => "nginx-access-log"
start_position => "beginning"
stat_interval => "2"
}
}
output {
elasticsearch {
hosts => ["ip:9200"]
index => "nginxlog"
}
}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。