1.注意,logstash版本必须要求1.5
2.编辑mail.conf
 
input {
    stdin {
         }
    }
output {
     email {
        body => "%{message}" 发送内容
        from => "xxxxx@sina.com"  发送邮箱
        contenttype => "text/plain; charset=UTF-8"
        options => [
                "smtpIporHost", "smtp.sina.com",
                "userName", "xxxxxx",  这里直接是用户名,不需要加@sina.com
                "password", "*********", 如果允许用密码就用有限密码, 不允许就用授权码
                "authenticationType", "login"  
        ]
        subject => "服务器%{host} %{type}日志异常" (邮件标题,自定义)
        to => "xxx@xx.com"
}
 
测试正常发送邮件。