No emails received from logstash for email output plugin

I do not get any emails from logstash for the below config. Could anyone please help me what is going wrong, also please let me know where can I trace the email logs. There is no any error on running the the config file.

if "INFO" in [MessageType] {
email {
to => "mymail_id@ec.com"
from => "logstash.alert@example.com"
username => "mymail_id@ec.com"
password => "Amma@456"
port => "465"
via => "sendmail"
use_tls => true
address => "https://outlook.office365.com/mapi/emsmdb/?MailboxId=d68b1c17-86f8-4b15-9764-d110f5b6b3f1@ec.com"
body => "%{message}"

            }

    stdout { }

file{ path => "/home/TESTING/trap_testing/CONSOL/INFO.log"}

}

could you please help me on this what i did wrong

If there's nothing in your log perhaps the if "INFO" in [MessageType] { conditional isn't true.

port => "465"
via => "sendmail"
use_tls => true
address => "https://outlook.office365.com/mapi/emsmdb/?MailboxId=d68b1c17-86f8-4b15-9764-d110f5b6b3f1@ec.com"

The address option should contain the address of an SMTP server. Also, with via => "sendmail" the port, use_tls, and address options are ignored.

port , use_tls, and address deleted from my configuration file but i am not getting email alert to mail id. please find the modified file

if "INFO" in [MessageType] {
email {
to => "mymail_id@ec.com"
from => "logstash.alert@example.com"
username => "mymail_id@ec.com"
password => "Amma@456"
via => "sendmail"
body => "%{message}"

        }

stdout { }

file{ path => "/home/TESTING/trap_testing/CONSOL/INFO.log"}

}

Again, how do you know the conditional is true so that the email output even runs? Are you running a local MTA that accepts and sends email to the destination? If not you shouldn't use via => "sendmail".

Hi Magnusbaeck,

i checked conditional is true, i received the output on console. but did not get email alerts.

Hi Magnusbaeck,

i am getting email alerts to my mail id, but some times not received. may i know the reason. if you have any idea please reply me

Check the logs of your local mail server to get clues about when the message disappears (i.e. does the message reach the mail server or not).

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