I am trying configuring gmail smtp but when sending test email using below command getting below error.
Any help will be appreciated.
index=_internal | head 1 | sendemail to="XXXXXXXX@gmail.com" format="html" server=smtp.gmail.com:587 use_tls=1
command="sendemail", (530, b'5.7.0 Authentication Required. Learn more at\n5.7.0 https://support.google.com/mail/?p=WantAuthError w22-20020a1709027b9600b0019a593e45f1sm196622pll.261 - gsmtp', 'email@example.com') while sending mail to: @XXXXXXX@gmail.com
Currently gmail don't allow use smtp server as earlier. Instead it wants to use more secure authentication. For that reason the old way is not working anymore with Splunk. Fortunately they have implemented 2-factor authentication and additional app password feature which you could use.
Here is steps to do it
index=_internal | head 1 | sendemail to="<your test email recipient>" subject=test sendresults=true format=table sendcsv=false