在Ubuntu上安装Filebeat主要有两种方法:
sudo apt update。wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -。sudo nano /etc/apt/sources.list.d/elastic-7.x.list,添加deb https://artifacts.elastic.co/packages/7.x/apt stable main(版本号可按需调整)。sudo apt update。sudo apt install filebeat。sudo apt update,sudo apt install snapd。sudo snap install core。sudo snap install filebeat --classic。安装完成后,可参考中方法编辑配置文件/etc/filebeat/filebeat.yml,然后使用sudo systemctl start filebeat和sudo systemctl enable filebeat启动并设置开机自启。