Issue when sending email alert on some particular event using gmail smtp server

Hi,

I am facing problem when trying to send email alert on particular event using gmail smtp,
Below is my email configuration inside output block following exception.

	output {
			email  {
				 port           =>    587
				 address        =>    "smtp.gmail.com"
				 username       =>    "bra_vinay@gmail.com"
				 password       =>    "mypassword
				 authentication =>   "login"
				 use_tls		=>     true
				 from           =>    "bra_vinay@gmail.com"
				 subject        =>    "logstash alert"
				 to             =>    "vikumar@bravurasolutions.com"
				 via            =>    "smtp"
				 body           =>    "Here is the event line that occured"
				 debug 			=> 	   true
			}
	}

Exception:
←[31mSomething happen while delivering an email {:exception=>#<Net::SMTPAuthenticationError: 530 5.7.0 Must issue a STARTTLS command first. ty6sm9782236pac.18 - gsmtp

, :level=>:error}←[0m

After enabling the use_tls = true in my configuration

email {
port => 587
address => "smtp.gmail.com"
username => "bra_vinay@gmail.com"
password => "duster123"
authentication => "plain"
use_tls => true
from => "bra_vinay@gmail.com"
subject => "logstash alert"
to => "vikumar@bravurasolutions.com"
via => "smtp"
body => "Here is the event line that occured"
debug => true
}

E:\Code_Athon\Setups\logstash-2.3.4\logstash-2.3.4\bin>logstash -f bra_login.conf
i←[31mSomething happen while delivering an email {:exception=>#<Net::SMTPAuthenticationError: 535-5.7.8 Username and Password not accepted. Learn more at

, :level=>:error}←[0m

Setting authentication method as login instead of plain

email {
port => 587
address => "smtp.gmail.com"
username => "bra_vinay@gmail.com"
password => "mypassword
authentication => "login"
use_tls => true
from => "bra_vinay@gmail.com"
subject => "logstash alert"
to => "vikumar@bravurasolutions.com"
via => "smtp"
body => "Here is the event line that occured"
debug => true
}

E:\Code_Athon\Setups\logstash-2.3.4\logstash-2.3.4\bin>logstash -f bra_login.conf
io/console not supported; tty will not be manipulated
Settings: Default pipeline workers: 4
Pipeline main started
←[31mSomething happen while delivering an email {:exception=>#<Net::SMTPAuthenticationError: 535-5.7.8 Username and Password not accepted. Learn more at

, :level=>:error}←[0m

Setting authentication method as login instead of plain

email {
port => 587
address => "smtp.gmail.com"
username => "bra_vinay@gmail.com"
password => "mypassword
authentication => "login"
use_tls => true
from => "bra_vinay@gmail.com"
subject => "logstash alert"
to => "vikumar@bravurasolutions.com"
via => "smtp"
body => "Here is the event line that occured"
debug => true
}

E:\Code_Athon\Setups\logstash-2.3.4\logstash-2.3.4\bin>logstash -f bra_login.conf
io/console not supported; tty will not be manipulated
Settings: Default pipeline workers: 4
Pipeline main started
←[31mSomething happen while delivering an email {:exception=>#<Net::SMTPAuthenticationError: 535-5.7.8 Username and Password not accepted. Learn more at

, :level=>:error}←[0m

With below system configuration:

1 Version: logstash2.3.4
2 Operating System:Microsoft Windows 8.1 Enterprise 6.3.9600 N/A Build 9600 -Java version : java version "1.7.0_65" Java(TM) SE Runtime Environment (build 1.7.0_65-b19) Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)
3 Config File (if you have sensitive info, please remove it): Please refer sample data section
4 Sample Data: I am attaching all the configurations I have tried various configuration settings for email but no setting is working our for me. PFA file Sendloginconfiguration.txt for 1 sample configuration PFA file user_scenarios.txt for all other sample configurations and errors we are getting.
5 Steps to Reproduce:
6 Create a logstash configuration file after configuring e-mail options
7 Start the logstash to read the logs
8 Logstash will read the logs as expected and do apply the GROK as well , no issues till this point.
9 Try sending e-mail on all the events , I have not used any IF constraints to restrict e-mail delivery, as I am at very beginning level

Any help would be much appreciated.

Thanks & Regards,
Rahul Kumar.

Please have a look at https://support.google.com/mail/answer/14257.

Thanks Magnus.