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
input
{
heartbeat {
interval => 10
type => "heartbeat"
}
}
output {
#stdout { codec => json_lines }
if [type] == "heartbeat" {
email
{
from => 'abc@gmail.com'
to => 'abc@gmail.com'
port => 25
domain => 'mail.logstash.net'
}
}
elasticsearch {
index => "time3"
document_type => "time3"
hosts => "localhost"
}
}

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

Can you help me with this

domain => 'mail.logstash.net'

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.