Logstash 邮件报警
2018-11-21 本文已影响30人
tingshuo123
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!"
}
}