Alerting

Unable to send test email from Splunk

mukeshprasad4u
New Member

I am trying configuring gmail smtp but when sending test email using below command getting below error. 

Any help will be appreciated. 

Command:

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', 'splunk@ip-172-31-36-251.ap-south-1.compute.internal') while sending mail to: @XXXXXXX@gmail.com

Labels (1)
0 Karma

marioespbaires
Loves-to-Learn

Hello,

by any chance, did you find a solution for this? I got the same issue right now.

0 Karma

isoutamo
SplunkTrust
SplunkTrust

 

Hi

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

  1. https://support.google.com/accounts/answer/185833?sjid=13755993998155727325-EU#:~:text=to%2520your%2...
    1. Check above instructions and ensure that you have 2-step verification on (probably this is as Google has enabled it for all)
    2. Create a new app password for your Splunk server
    3. Login to your local splunk instance
        1. Settings -> Server settings
        2. Email settings
          1. Mail host: smtp.gmail.com:587
          2. Email security: Enable TLS
          3. Username: Your Gmail account where you have enabled 2 Step verification
          4. Password: App password for above Gmail account
          5. Allowed Domains: <add what is needed>
          6. Save
        3. Go to search GUI:

 

index=_internal
| head 1
| sendemail to="<your test email recipient>" subject=test sendresults=true format=table sendcsv=false

 

r. Ismo

 

Tags (1)
0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Data Persistence in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. What happens if the OpenTelemetry collector ...

Thanks for the Memories! Splunk University, .conf25, and our Community

Thank you to everyone in the Splunk Community who joined us for .conf25, which kicked off with our iconic ...

Introducing Splunk 10.0: Smarter, Faster, and More Powerful Than Ever

Now On Demand Whether you're managing complex deployments or looking to future-proof your data ...