在Ubuntu上使用Filebeat监控网络流量,可参考以下步骤:
/etc/filebeat/filebeat.yml
,可启用system
模块中的network
子模块来监控网络流量,也可配置packetbeat
来捕获特定端口的网络流量,还可指定要监控的日志文件路径。sudo systemctl start filebeat
启动服务,sudo systemctl enable filebeat
设置为开机自启。sudo systemctl status filebeat
查看服务状态,sudo journalctl -u filebeat -f
查看日志文件,确保配置正确。