首先通过下面命令:
ps aux|grep logstash
查出系统安装logstash的位置以及运行的配置。
找到正确的配置文件,然后修改如下:
input {
file {
path => ["/usr/local/openresty/nginx/logs/api_access.log"]
type => "nginx_access"
codec => "json"
}
}
output {
redis {
host => "127.0.0.1"
port => 63798
db => 0
data_type => "list"
key => "detail_log_list"
password => "pws"---添加的密码
}
}
然后将旧实例强制杀死:kill -9 26651
最后在将配置文件重启就可以了: ./bin/logstash -f ./logstash.conf