Getting Data In

How to modify the time stamp format when i run a scheduled pdf?

ppurokit
Path Finder

I have a dashboard which has some 6 items as part of it.

I have a scheduled to email the dashboard every 24 hours.

The Dashboard name is "cpy001_daily_reports_"

When i receive the email in pdf I see that the attachment has the date appended to it as "cpy001_daily_reports_-2013-04-23.pdf"

But i have to modify the above time stamp format which is getting appended to the attachment and i want it in the following format as "_"

Please let me know how will i be able to change the time stamp format here ?

0 Karma
1 Solution

TimMc
Explorer

You could change the following line in $SPLUNK_HOME/etc/apps/search/bin/sendemail.py:

datestamp = time.strftime('%Y-%m-%d')

To something like this:

datestamp = time.strftime('%Y%m%d%H%M%S')

This solution might not be supportable going forward if sendemail.py is overwritten by a newer version of Splunk during an update.

Feature request?

See also:

Tim.

View solution in original post

TimMc
Explorer

You could change the following line in $SPLUNK_HOME/etc/apps/search/bin/sendemail.py:

datestamp = time.strftime('%Y-%m-%d')

To something like this:

datestamp = time.strftime('%Y%m%d%H%M%S')

This solution might not be supportable going forward if sendemail.py is overwritten by a newer version of Splunk during an update.

Feature request?

See also:

Tim.

Get Updates on the Splunk Community!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...