<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How do I add yesterday's date to an emailed report subject? in Reporting</title>
    <link>https://community.splunk.com/t5/Reporting/How-do-I-add-yesterday-s-date-to-an-emailed-report-subject/m-p/452059#M7310</link>
    <description>&lt;P&gt;I don't think you need to modify sendemail.py in order for this to work. If you copy the line above exactly as it is into your SPL, which is your splunk query, it will create a hidden column that evaluates to the previous day. If you want to see the column remove the underscore from the beginning of the name, do &lt;CODE&gt;| eval yesterday = . . .&lt;/CODE&gt; instead. I would suggest to add the line for the date as the last line of your SPL and use a scheduled report to get the email sent out.&lt;/P&gt;</description>
    <pubDate>Wed, 18 Dec 2019 15:03:06 GMT</pubDate>
    <dc:creator>harfel</dc:creator>
    <dc:date>2019-12-18T15:03:06Z</dc:date>
    <item>
      <title>How do I add yesterday's date to an emailed report subject?</title>
      <link>https://community.splunk.com/t5/Reporting/How-do-I-add-yesterday-s-date-to-an-emailed-report-subject/m-p/452054#M7305</link>
      <description>&lt;P&gt;I have a scheduled report for the previous day's data that gets emailed. I'm trying to include the previous days date in the subject line.&lt;/P&gt;

&lt;P&gt;I've tried evaluating a field ReportDate in which the value is yesterday's date and then hiding the field since I don't want it in the report. I then put $result.ReportDate$, but this of course did not work since that field isn't included.&lt;/P&gt;

&lt;P&gt;Advice?&lt;/P&gt;</description>
      <pubDate>Fri, 07 Sep 2018 20:12:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/How-do-I-add-yesterday-s-date-to-an-emailed-report-subject/m-p/452054#M7305</guid>
      <dc:creator>matstap</dc:creator>
      <dc:date>2018-09-07T20:12:05Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add yesterday's date to an emailed report subject?</title>
      <link>https://community.splunk.com/t5/Reporting/How-do-I-add-yesterday-s-date-to-an-emailed-report-subject/m-p/452055#M7306</link>
      <description>&lt;P&gt;I don't think there is any other way possible. You probably have to include the field ReportDate in your search results and then use the token &lt;CODE&gt;$result.ReportDate$&lt;/CODE&gt;in alert email subject.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Sep 2018 20:28:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/How-do-I-add-yesterday-s-date-to-an-emailed-report-subject/m-p/452055#M7306</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-09-07T20:28:29Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add yesterday's date to an emailed report subject?</title>
      <link>https://community.splunk.com/t5/Reporting/How-do-I-add-yesterday-s-date-to-an-emailed-report-subject/m-p/452056#M7307</link>
      <description>&lt;P&gt;Add this to your SPL&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval _yesterday = strftime(relative_time(now(), "-1d@d"), "%m/%d")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then reference it as &lt;CODE&gt;$result._yesterday$&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 09 Sep 2018 03:01:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/How-do-I-add-yesterday-s-date-to-an-emailed-report-subject/m-p/452056#M7307</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2018-09-09T03:01:54Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add yesterday's date to an emailed report subject?</title>
      <link>https://community.splunk.com/t5/Reporting/How-do-I-add-yesterday-s-date-to-an-emailed-report-subject/m-p/452057#M7308</link>
      <description>&lt;P&gt;There is a few job property tokens that you could use for this, I think.&lt;BR /&gt;
in your email, you could use $job.earliestTime$ or $job.latestTime$ to get the earliest or latest time of the search window. &lt;/P&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/latest/Alert/EmailNotificationTokens#Job_information_tokens"&gt;https://docs.splunk.com/Documentation/SplunkCloud/latest/Alert/EmailNotificationTokens#Job_information_tokens&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2018 15:51:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/How-do-I-add-yesterday-s-date-to-an-emailed-report-subject/m-p/452057#M7308</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2018-09-13T15:51:37Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add yesterday's date to an emailed report subject?</title>
      <link>https://community.splunk.com/t5/Reporting/How-do-I-add-yesterday-s-date-to-an-emailed-report-subject/m-p/452058#M7309</link>
      <description>&lt;P&gt;Hi Woodcock,&lt;/P&gt;

&lt;P&gt;I am having same issue of adding yesterday's date in my email message. You mentioned to add above eval in SPL. Could you please elaborate how to add it.&lt;/P&gt;

&lt;P&gt;I tried to add it by editing sendemail.py but it is not working. Do I need to import any packages to use below code&lt;BR /&gt;
yesterday = datetime.datetime.now() - datetime.timedelta(days = 1)&lt;BR /&gt;
ssContent['action.email.message'] = argvals.get('message') + " "+ yesterday.strftime("%d.%m.%Y")&lt;/P&gt;

&lt;P&gt;Please help.. Sorry for adding comment in this existing post&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2019 13:57:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/How-do-I-add-yesterday-s-date-to-an-emailed-report-subject/m-p/452058#M7309</guid>
      <dc:creator>poddraj</dc:creator>
      <dc:date>2019-12-18T13:57:54Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add yesterday's date to an emailed report subject?</title>
      <link>https://community.splunk.com/t5/Reporting/How-do-I-add-yesterday-s-date-to-an-emailed-report-subject/m-p/452059#M7310</link>
      <description>&lt;P&gt;I don't think you need to modify sendemail.py in order for this to work. If you copy the line above exactly as it is into your SPL, which is your splunk query, it will create a hidden column that evaluates to the previous day. If you want to see the column remove the underscore from the beginning of the name, do &lt;CODE&gt;| eval yesterday = . . .&lt;/CODE&gt; instead. I would suggest to add the line for the date as the last line of your SPL and use a scheduled report to get the email sent out.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2019 15:03:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/How-do-I-add-yesterday-s-date-to-an-emailed-report-subject/m-p/452059#M7310</guid>
      <dc:creator>harfel</dc:creator>
      <dc:date>2019-12-18T15:03:06Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add yesterday's date to an emailed report subject?</title>
      <link>https://community.splunk.com/t5/Reporting/How-do-I-add-yesterday-s-date-to-an-emailed-report-subject/m-p/452060#M7311</link>
      <description>&lt;P&gt;Open the &lt;CODE&gt;Saved Search&lt;/CODE&gt; that is generating the email and add my answer to the bottom of the search string and click the &lt;CODE&gt;Save&lt;/CODE&gt; button.  Then to back and edit the email &lt;CODE&gt;Alert Action&lt;/CODE&gt; associated with the &lt;CODE&gt;Saved Search&lt;/CODE&gt; and add &lt;CODE&gt;$result._yesterday$&lt;/CODE&gt; to the email subject.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2019 15:43:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/How-do-I-add-yesterday-s-date-to-an-emailed-report-subject/m-p/452060#M7311</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-12-18T15:43:36Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add yesterday's date to an emailed report subject?</title>
      <link>https://community.splunk.com/t5/Reporting/How-do-I-add-yesterday-s-date-to-an-emailed-report-subject/m-p/452061#M7312</link>
      <description>&lt;P&gt;Thanks Woodcock, that worked as perfect as I am looking for..&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2019 16:49:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/How-do-I-add-yesterday-s-date-to-an-emailed-report-subject/m-p/452061#M7312</guid>
      <dc:creator>poddraj</dc:creator>
      <dc:date>2019-12-18T16:49:44Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add yesterday's date to an emailed report subject?</title>
      <link>https://community.splunk.com/t5/Reporting/How-do-I-add-yesterday-s-date-to-an-emailed-report-subject/m-p/452062#M7313</link>
      <description>&lt;P&gt;OK, then be sure to come back here and click &lt;CODE&gt;Accept&lt;/CODE&gt; on this answer to close the question and help anybody else coming behind you asking for something similar.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2019 18:09:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/How-do-I-add-yesterday-s-date-to-an-emailed-report-subject/m-p/452062#M7313</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-12-18T18:09:05Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add yesterday's date to an emailed report subject?</title>
      <link>https://community.splunk.com/t5/Reporting/How-do-I-add-yesterday-s-date-to-an-emailed-report-subject/m-p/708145#M12658</link>
      <description>&lt;P&gt;thanks, this worked for me as well. Is there a way to rename the csv attached to the report ?&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jan 2025 13:28:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/How-do-I-add-yesterday-s-date-to-an-emailed-report-subject/m-p/708145#M12658</guid>
      <dc:creator>tomapatan</dc:creator>
      <dc:date>2025-01-07T13:28:00Z</dc:date>
    </item>
  </channel>
</rss>

