在Debian上管理Filebeat服务,可通过以下方式:
使用APT包管理器安装,命令为:sudo apt update,sudo apt install filebeat。
编辑配置文件/etc/filebeat/filebeat.yml,设置输入源和输出目标等参数,如指定要监控的日志文件路径及输出到Elasticsearch的地址等。
使用sudo systemctl start filebeat启动服务,sudo systemctl stop filebeat停止服务。
使用sudo systemctl enable filebeat设置Filebeat服务开机自启。
通过sudo systemctl status filebeat查看服务状态,或用sudo tail -f /var/log/filebeat/filebeat查看日志文件来监控运行情况。
先备份配置文件,然后使用sudo apt-get update和sudo apt-get install filebeat更新软件包,再重新配置并启动服务。