安装

  1. 执行如下命令:
  2. sudo rpm --import https://packages.elastic.co/GPG-KEY-elasticsearch
  3. /etc/yum.repos.d/ 文件夹下创建名为elastic.repo的文件,编辑文件内容如下:
  4. [elastic-8.x]
  5. name=Elastic repository for 8.x packages
  6. baseurl=https://artifacts.elastic.co/packages/8.x/yum
  7. gpgcheck=1
  8. gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
  9. enabled=1
  10. autorefresh=1
  11. type=rpm-md
  12. 之后执行如下命令安装filebeats:
  13. sudo yum install filebeat
  14. 设置filebeats自启动:
  15. sudo systemctl enable filebeat(基予systemd
  16. sudo chkconfig --add filebeat

filebeat配置文件demofilebeat.yml