Logstash 邮件报警

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       =>    "[email protected]"
        password       =>    "qugbpxrclkvdbfcg"
        authentication =>    "plain"
        use_tls        =>    false
        from           =>    "[email protected]"
        subject        =>    "Warning: you have an error!"
        to             =>    "[email protected], [email protected], [email protected], [email protected], [email protected]"
        via            =>    "smtp"
        body           =>    "you hava an error of plat_inter_error!"
    }
}

你可能感兴趣的:(Logstash 邮件报警)