%{message} is always empty

I want to send an email notification if there are any errors inside the Logstash import process.
For this I'm using the email plugin inside the output section
output {
email {
to => "mail@gmail.com"
from => "server@server.com"
body => "%{message}"
address => "address"
port => port
username => "username"
password => "password"
use_tls => true
debug => true
authentication => "login"
subject => "subject"
}
}

I want to check the %{message} to see if there are any errors but the "%{message} is always empty.

Do you know why "%{message}" is always empty or some other way to send an email notification if there are any errors inside the Logstash import process?

Have you tried to replace your output to stdout so you can see what the data looks like and if there is a field called message?

I would try that first and if you still need help post your entire Logstash config so we can see the input and filters along with a sample of the data that is going through the input if possible.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.