Alerting using Logstash e-mail capability
Alerting is a key aspect of analytics. You cannot continuously monitor logs or any other stats 24x7, and you need to be alerted when some specific event happens. For example, if there is any error occurring in logs, you would always want to be notified of it. Nobody can tolerate an error on a production server.
Let's use the e-mail capability of Logstash for e-mail notifications whenever some errors occur. For this, we will use e-mail output plugin of logstash. This plugin is not part of logstash packaging, but we can install it using:
bin/logstash-plugin install logstash-output-email
Once the plugin is installed, we can use it in the output section. Add the following configuration to the output section to configure your Gmail account to send an e-mail:
if [level] == "ERROR" { email { address => "smtp.gmail.com" port => "587" username => "mes.packt" password => "<...