Email on alert

I am using logstash 5.3.I am taking records from oracle database as a cron job.

I need to send a email to sort problem which arises when logstash is loading data or elasticsearch server is down
Can someone help me with this?

One avenue to explore could be to configure Logstash to have an output that send heartbeats to a heartbeat monitoring tool like Lovebeat. If the Logstash pipeline is clogged (e.g. because of ES problems) the heartbeats won't be sent either and you'll get an alert.

thanks @magnusbaeck

this is my config
heartbeat {
interval => 10
type => "heartbeat"
output {
#stdout { codec => json_lines }
if [type] == "heartbeat" {
from => ''
to => ''
port => 25
domain => ''
elasticsearch {
index => "time3"
document_type => "time3"
hosts => "localhost"

but i get the following error
19:47:23.914 [[main]>worker0] ERROR - Something happen wh
ile delivering an email {:exception=>#<Errno::ECONNREFUSED: Connection refused -
Connection refused>}

Can you help me with this

domain => ''

This is bogus, remove it. The documentation of the domain is really bad so I can't blame you; I'll send a PR to improve it.

You have configured the email output to connect to localhost:25. It seems you don't have an SMTP server running at that location. Either make sure you are or reconfigure Logstash to connect to a working SMTP server.

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