例子:
重启filebeat
升级版
#!/bin/bash
ps -ef|grep "filebeat" |grep -v grep|cut -c 9-15|xargs kill -9
cd /data/logs/
nohup /data/elk/filebeat-6.0.0/filebeat -e -c /data/elk/filebeat-6.0.0/php_api.yml &
基础版
#!/bin/bash
pid=`ps -ef | grep "filebeat" | grep php_api.yml | awk '{printf $2}'`
echo $pid
kill -9 $pid
cd /data/logs/
nohup /data/elk/filebeat-6.0.0/filebeat -e -c /data/elk/filebeat-6.0.0/php_api.yml &