ELK 状态码报警

下载sendEmail

wget http://caspian.dotconf.net/menu/Software/SendEmail/sendEmail-v1.56.tar.gz

tar -zxvf  sendEmail-v1.56.tar.gz

mv sendEmail-v1.56/sendEmail  /usr/local/bin/


下载logstash-output-exec 插件

git clone https://github.com/logstash-plugins/logstash-output-exec.git



配置一条

output {
#if [http_status_code] == "500" or [time_duration] >= 10 {  
if [http_status_code] == "500" {  
  exec {
      command => "/usr/local/bin/sendEmail -f 'Data center <****@163.com>' -t *****@163.com -s smtp.163.com -xu ****@163.com -xp '*****' -u '%{baseurl}' -m '%{http_status_code}'"
        }


你可能感兴趣的:(ELK,之nginx,日志分析)