Splunk Search

Where are the failures of sendemail logged in?

danielbb
Motivator

Does anybody know where the failures of sendemail are being logged? I wonder about cases where the e-mail address no longer exists and what type of error is generated and where. _internal and _audit don't seem to have this data.

0 Karma

dhsmith21
Observer

This should get you everything you need: index=_internal sourcetype=splunk_python error

0 Karma

dhsmith21
Observer

I know this is an older thread, but I am searching for a good way to get notifications for when and email fails to be sent as well.

I did find you can see these in $SPLUNK_HOME/var/log/splunk/python.log. 

Specifically for my use case it is around the allowed domain list not having the domain listed.
If I find a good way to detect this within a standard or REST Splunk search I will reply.  Hope this helps some.

0 Karma

PickleRick
SplunkTrust
SplunkTrust

There are two possible cases here.

1) The sendemail command (or the equivalent alert action) is unable to submit the email for delivery to the immediate SMTP server (due to bad/lack of authentication, network problems and so on). Those kinds of problems will be reported as logs from sendemail.py as @nyc_jason already showed

2) The email is properly submitted to the SMTP server but the delivery process doesn't complete properly (due to one of the many possible problems that can happen in email path) - well, then you have to troubleshoot your email system just like you would do with any other email. If the email generated from Splunk has some deliverable From address configured you might want to check the corresponding mailbox to see whether there were no delivery problem reports generated.

yuanliu
SplunkTrust
SplunkTrust

Are you looking for logs from your actual mail transfer agent (aka SMTP server) or an existing source in Splunk?  Unless you actually ingest mail log, it won't be available.

When you say "e-mail address no longer exists," you don't mean that outlook.com used to exist but no longer, but a user's mailbox used to exist but no longer.  Is this correct?  Unless the server is rejecting connection (e.g., outlook.com all in a sudden stopped), Splunk submits data and will have no knowledge about mail handling.  Only the MTA log will contain what you needed.

danielbb
Motivator

Great. What sort of errors _does_ sendemail report on?

0 Karma

nyc_jason
Splunk Employee
Splunk Employee

try this:
index=_internal source=*python.log sendemail

danielbb
Motivator

Thank you, but unfortunately it doesn't show the failures.

0 Karma

dhsmith21
Observer

This should get the failed sendmail items, but doesn't appear get the ones dropped by allowed email domains list not including the domain. Still researching that use case.  

index=_internal sourcetype=splunk_python ("Name or service not known while sending mail to" OR "Connection timed out while sending mail to")

some | rex maybe needed to make this more useful.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Take Action Automatically on Splunk Alerts with Red Hat Ansible Automation Platform

 Are you ready to revolutionize your IT operations? As digital transformation accelerates, the demand for ...

Calling All Security Pros: Ready to Race Through Boston?

Hey Splunkers, .conf25 is heading to Boston and we’re kicking things off with something bold, competitive, and ...

Beyond Detection: How Splunk and Cisco Integrated Security Platforms Transform ...

Financial services organizations face an impossible equation: maintain 99.9% uptime for mission-critical ...