下载rpm包
[root@ip-172-31-0-46 ~]# wget https://artifacts.elastic.co/downloads/logstash/logstash-7.17.0-x86_64.rpm
安装rpm包
[root@ip-172-31-0-46 ~]# yum install -y logstash-7.17.0-x86_64.rpm
添加日志拉取
[root@ip-172-31-0-46 ~]# cd /etc/logstash/conf.d/
root@ip-172-31-0-46 conf.d]# vim puff-gateserver.conf
input {
file {
path => "/workspace/puffserver/puffdeploy/puff-488/logs/gateserver.log"
path => "/workspace/puffserver/puffdeploy/puff-488/logs/gateserver.log.err"
}
}
output {
elasticsearch {
hosts => ["http://10.98.211.174:9200"]
index => "puff-gateserver-%{+YYYY.MM.dd}"
user => "elastic"
password => "c-{vq%oEddad_mq;>1Op99"
}
}
启动Logstash
[root@ip-172-31-0-46 conf.d]# systemctl start logstash
评论