Logstash系列:发送邮件告警、发送POST告警_其他

邮件告警

output {
if "shouldmail" in [tags] {
email {
to => 'technical@example.com'
from => 'monitor@example.com'
subject => 'Alert - %{title}'
body => "Tags: %{tags}\\n\\Content:\\n%{message}"
template_file => "/tmp/email_template.mustache"
domain => 'mail.example.com'
port => 25
}
}
}

POST告警

output {
http {
url => "http://alert:port/api/"
http_method => "post"
}
}