Alerting

Alert e-mail has no Date: field

mmather67
Path Finder

I have gotten alerts to work in Splunk, and they send e-mails. But, unfortunately, there is no Date: field among the e-mail headers.

Almost all other e-mails I get have this Date: field, and it is used to sort them. Without a date, the alerts get sorted to the wrong end of my e-mails, which is not helpful.

I have looked at python.log, and don't notice anything.

What might be wrong?

Tags (2)
0 Karma

mmather67
Path Finder

Well, I fixed this myself, by editing splunk/etc/apps/search/bin/sendemail.py.

About line 17, before TIMEOUT=600, I added the line:

from time import strftime, gmtime, time

About line 145, before the comment # Clear leading / trailing whitespace ... I added the line:

message ['Date'] = strftime ("%a, %d %b %Y %H:%M:%S", gmtime (time()))

That seems to work -- now I just have to remember to make a similar change to any update of Splunk.

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!

.conf25 Global Broadcast: Don’t Miss a Moment

Hello Splunkers, .conf25 is only a click away.  Not able to make it to .conf25 in person? No worries, you can ...

Observe and Secure All Apps with Splunk

 Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

What's New in Splunk Observability - August 2025

What's New We are excited to announce the latest enhancements to Splunk Observability Cloud as well as what is ...