共计 666 个字符,预计需要花费 2 分钟才能阅读完成。
1. 用于 saltstack 自动化部署模式:所有输出全部定向到 /dev/null,可以实现在自动化下发配置的时候 salt 命令全程不卡住
#!/bin/bash
ps aux |grep "filebeat" |grep -v "auto" |awk '{print $2}' |xargs kill -9 >/dev/null 2>&1
nohup /data/filebeat/filebeat -e -c filebeat.yml >/dev/null 2>&1 &
2、简单排错模式:把 debug 输出重定向追加到文件,适用于判断与 ES VIP 后端节点的通信情况判断,以及简单的判断 filebeat 是否启动 harvester 组件采集某个路径下的日志
#!/bin/bash
ps aux |grep "filebeat" |grep -v "auto" |awk '{print $2}' |xargs kill -9 >/dev/null 2>&1
nohup /data/filebeat/filebeat -e -c filebeat.yml 2>> filebeat.log &
3、全部 debug selector 都开启模式:适用于分析 filebeat 全部采集链路,非特殊情况慎用,用完及时关闭,否者短时间内日志暴涨几十 G
#!/bin/bash
ps aux |grep "filebeat" |grep -v "auto" |awk '{print $2}' |xargs kill -9 >/dev/null 2>&1
nohup /data/filebeat/filebeat -e -d "*" -c filebeat.yml 2>> filebeat.log &
正文完