Hi folks,
I've recently written a couple of email
module output blocks to notify Teams / PagerDuty when errors occur in our live environment.
My Logstash output looks like this:
output {
if "PROD" in [log.environment] {
# All log.error messages spammed to Alerts & Notifications channel
if "output-teams" in [tags] {
# Some of our logs are based on REQUEST/RESPONSE and just include a status. These should always be 500+ errors
if [app.req.destination] and [app.req.method] {
email {
<< email stuff >>
}
}
# Our newer logs however use "app.logText" and "app.error.messages/response"
else if [app.logText] {
email {
<< email stuff >>
}
}
}
# 500 errors logged out to PagerDuty
if "output-pagerduty" in [tags] {
email {
<< email stuff >>
}
}
}
elasticsearch {
hosts => "10.128.x.x"
index => "xxx-%{[@metadata][beat]}-%{[@metadata][version]}-%{+YYYY.MM.dd}"
}
# comment this out on Pre-Prod and Prod environments
stdout { codec => rubydebug }
}
This works - the e-mails arrive in Teams as expected:
However, I can't now see the log entry in Kibana...
Is it possible that because the log entry has been processed by the email
plugin, it's then not getting processed by the elasticsearch
plugin?