【发布时间】:2014-08-14 19:19:49
【问题描述】:
我将 logstash 配置为发送电子邮件警报,以防日志消息中出现某些单词组合。我收到警报,但没有收到警报中的消息字段值,而是收到“@message”一词。 我该如何解决这个问题?
这是我的 logstash 配置文件:
root@srv-syslog:~# cat /etc/logstash/conf.d/central.conf
input {
syslog {
type => "syslog"
port => 5144
}
tcp {
type => "cisco_asa"
port => 5145
}
tcp {
type => "cisco_ios"
port => 5146
}
}
output {
elasticsearch {
bind_host => "127.0.0.1"
port => "9200"
protocol => http
}
if "executed the" in [message] {
email {
from => "logstash_alert@company.local"
subject => "logstash alert"
to => "myemail@company.local"
via => "smtp"
body => "Here is the event line that occured: %{@message}"
}
}
}
【问题讨论】:
标签: email message logstash alerts