美文网首页
Logstash 邮件报警

Logstash 邮件报警

作者: tingshuo123 | 来源:发表于2018-11-21 11:17 被阅读30次
    input {
    
      file {
        type => "192.168.1.234_plat_inter_error_log"
        path => ["/opt/log/plat_inter_error.*.log"]
        start_position => "beginning"
      }
    }
    
    output {
        elasticsearch {
            hosts => ["192.168.1.108:9200"]
            index => "logstash-%{type}-%{+YYYY.MM.dd}"
            document_type => "%{type}"
            workers => 1
            flush_size => 20000
            idle_flush_time => 10
            template_overwrite => true
        }
    
        email {
            port           =>    "25"
            address        =>    "smtp.qq.com"
            username       =>    "1820034099@qq.com"
            password       =>    "qugbpxrclkvdbfcg"
            authentication =>    "plain"
            use_tls        =>    false
            from           =>    "1820034099@qq.com"
            subject        =>    "Warning: you have an error!"
            to             =>    "duanyexuanmu@126.com, 907370586@qq.com, 1017458803@qq.com, 775166804@qq.com, 545786675@qq.com"
            via            =>    "smtp"
            body           =>    "you hava an error of plat_inter_error!"
        }
    }
    

    相关文章

      网友评论

          本文标题:Logstash 邮件报警

          本文链接:https://www.haomeiwen.com/subject/zjbqqqtx.html