Javascript

filebate安装读取nginx json日志

本文主要是介绍filebate安装读取nginx json日志,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

curl -L -O https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-7.12.1-x86_64.rpm
sudo rpm -vi filebeat-7.12.1-x86_64.rpm

cp /etc/filebeat/filebeat.yml /etc/filebeat/filebeat.yml.cp
cat > /etc/filebeat/filebeat.yml << EOF
filebeat.inputs:
- type: log
enabled: true
paths:
- /data/logs/*.json.log
json.keys_under_root: true
json.overwrite_keys: true


setup.template.settings:
index.number_of_shards: 3

output.elasticsearch:
hosts: ["IP:9200"]
index: "nginx-access-callback"
username: "elastic"
password: "RJXYOA7hXYKwbxcsVpCW"

setup.template.enable: true
setup.template.name: "nginx"
setup.template.pattern: "nginx-*"

setup.ilm.enabled: false
EOF

systemctl restart filebeat
systemctl status filebeat

这篇关于filebate安装读取nginx json日志的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!