<?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 can I set a report to run that includes events from 1 or 3 days prior based on the current day of the week? in Reporting</title>
    <link>https://community.splunk.com/t5/Reporting/How-can-I-set-a-report-to-run-that-includes-events-from-1-or-3/m-p/371820#M6364</link>
    <description>&lt;P&gt;Right. I have that part.... More specifically..... &lt;/P&gt;

&lt;P&gt;| eval start=if( (strftime(Now(),"%a") == "Mon"), "-3d0", "-1d") | eval r_time=strftime(relative_time(now(), start),"%m/%d/%Y:07:30:00") | where earliest=r_time &lt;/P&gt;

&lt;P&gt;However, it's not finding any results even thought I know they exist.&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 15:22:43 GMT</pubDate>
    <dc:creator>mumblingsages</dc:creator>
    <dc:date>2020-09-29T15:22:43Z</dc:date>
    <item>
      <title>How can I set a report to run that includes events from 1 or 3 days prior based on the current day of the week?</title>
      <link>https://community.splunk.com/t5/Reporting/How-can-I-set-a-report-to-run-that-includes-events-from-1-or-3/m-p/371818#M6362</link>
      <description>&lt;P&gt;I have a report that I'd like to create but I need to set the earliest clause based on the current day of the week. So for example. On Mondays I need to set earliest to -3d at 07:30:00 (So records from Friday @ 7:30am onward are captured). The rest of the days of the week I would like to set it to -1d at 07:30:00. &lt;/P&gt;

&lt;P&gt;I have the logic figured out on how to determine the day of the week, but things go sideways on me when I specify the earliest clause. &lt;/P&gt;</description>
      <pubDate>Wed, 16 Aug 2017 18:01:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/How-can-I-set-a-report-to-run-that-includes-events-from-1-or-3/m-p/371818#M6362</guid>
      <dc:creator>mumblingsages</dc:creator>
      <dc:date>2017-08-16T18:01:20Z</dc:date>
    </item>
    <item>
      <title>Re: How can I set a report to run that includes events from 1 or 3 days prior based on the current day of the week?</title>
      <link>https://community.splunk.com/t5/Reporting/How-can-I-set-a-report-to-run-that-includes-events-from-1-or-3/m-p/371819#M6363</link>
      <description>&lt;P&gt;to find current day of the week use like below&lt;/P&gt;

&lt;P&gt;|  eval DayOfWeek=strftime(_time, "%A")&lt;/P&gt;</description>
      <pubDate>Wed, 16 Aug 2017 18:05:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/How-can-I-set-a-report-to-run-that-includes-events-from-1-or-3/m-p/371819#M6363</guid>
      <dc:creator>sbbadri</dc:creator>
      <dc:date>2017-08-16T18:05:57Z</dc:date>
    </item>
    <item>
      <title>Re: How can I set a report to run that includes events from 1 or 3 days prior based on the current day of the week?</title>
      <link>https://community.splunk.com/t5/Reporting/How-can-I-set-a-report-to-run-that-includes-events-from-1-or-3/m-p/371820#M6364</link>
      <description>&lt;P&gt;Right. I have that part.... More specifically..... &lt;/P&gt;

&lt;P&gt;| eval start=if( (strftime(Now(),"%a") == "Mon"), "-3d0", "-1d") | eval r_time=strftime(relative_time(now(), start),"%m/%d/%Y:07:30:00") | where earliest=r_time &lt;/P&gt;

&lt;P&gt;However, it's not finding any results even thought I know they exist.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:22:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/How-can-I-set-a-report-to-run-that-includes-events-from-1-or-3/m-p/371820#M6364</guid>
      <dc:creator>mumblingsages</dc:creator>
      <dc:date>2020-09-29T15:22:43Z</dc:date>
    </item>
    <item>
      <title>Re: How can I set a report to run that includes events from 1 or 3 days prior based on the current day of the week?</title>
      <link>https://community.splunk.com/t5/Reporting/How-can-I-set-a-report-to-run-that-includes-events-from-1-or-3/m-p/371821#M6365</link>
      <description>&lt;P&gt;I think what you may have to do is set &lt;CODE&gt;earliest=-3d@d&lt;/CODE&gt; and then add in the logistics to filter out based on the current day.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|eval filter=if(relative_time(now(),"%w")=1,relative_time(now(),"-3d@d+7h+30m"),relative_time(now(),"-1d@d+7h+30m"))|where _time&amp;gt;=filter
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 16 Aug 2017 18:15:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/How-can-I-set-a-report-to-run-that-includes-events-from-1-or-3/m-p/371821#M6365</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2017-08-16T18:15:22Z</dc:date>
    </item>
    <item>
      <title>Re: How can I set a report to run that includes events from 1 or 3 days prior based on the current day of the week?</title>
      <link>https://community.splunk.com/t5/Reporting/How-can-I-set-a-report-to-run-that-includes-events-from-1-or-3/m-p/371822#M6366</link>
      <description>&lt;P&gt;Try like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=foo sourcetype=bar [| gentimes start=-1 | eval earliest=if(lower(strftime(now(),"%a"))="mon",relative_time(now(),"-3d@d+7h+30m"),relative_time(now(),"-1d@d+7h+30m") | table earliest  ]   | rest of the search
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 16 Aug 2017 18:34:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/How-can-I-set-a-report-to-run-that-includes-events-from-1-or-3/m-p/371822#M6366</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-08-16T18:34:34Z</dc:date>
    </item>
    <item>
      <title>Re: How can I set a report to run that includes events from 1 or 3 days prior based on the current day of the week?</title>
      <link>https://community.splunk.com/t5/Reporting/How-can-I-set-a-report-to-run-that-includes-events-from-1-or-3/m-p/371823#M6367</link>
      <description>&lt;P&gt;I think you are close.... I adapted what you wrote to the following.... &lt;/P&gt;

&lt;P&gt;index="my_index" | eval start=if( (strftime(Now(),"%a") == "Mon"), "-3d@d+7h+30m", "-10d@d+7h+30m") | eval r_time=relative_time(now(), start) | eval sr_time=strftime(r_time,"%m/%d/%Y:%X") | where _time &amp;gt;= r_time | table event_ID, _time, r_time&lt;/P&gt;

&lt;P&gt;but now I seem to be getting everything.... Looking at _time and r_time they are of different formats...&lt;/P&gt;

&lt;P&gt;_time = 2017-04-25 19:59:00&lt;BR /&gt;
r_time = 1502022600.000000&lt;/P&gt;

&lt;P&gt;Is that why??&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:22:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/How-can-I-set-a-report-to-run-that-includes-events-from-1-or-3/m-p/371823#M6367</guid>
      <dc:creator>mumblingsages</dc:creator>
      <dc:date>2020-09-29T15:22:51Z</dc:date>
    </item>
    <item>
      <title>Re: How can I set a report to run that includes events from 1 or 3 days prior based on the current day of the week?</title>
      <link>https://community.splunk.com/t5/Reporting/How-can-I-set-a-report-to-run-that-includes-events-from-1-or-3/m-p/371824#M6368</link>
      <description>&lt;P&gt;add this before where condition  | eval r_time=strftime(r_time,"%Y-%m-%d %H:%M:%S)&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:22:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/How-can-I-set-a-report-to-run-that-includes-events-from-1-or-3/m-p/371824#M6368</guid>
      <dc:creator>sbbadri</dc:creator>
      <dc:date>2020-09-29T15:22:54Z</dc:date>
    </item>
    <item>
      <title>Re: How can I set a report to run that includes events from 1 or 3 days prior based on the current day of the week?</title>
      <link>https://community.splunk.com/t5/Reporting/How-can-I-set-a-report-to-run-that-includes-events-from-1-or-3/m-p/371825#M6369</link>
      <description>&lt;P&gt;_time is in epoch, but displays in human-readable. if you were to add &lt;CODE&gt;|eval time=_time&lt;/CODE&gt; it should display time as epoch, as well.&lt;BR /&gt;
try changing &lt;CODE&gt;strftime(now(),"%a")&lt;/CODE&gt;,  to &lt;CODE&gt;relative_time(now(),"%a")&lt;/CODE&gt; in your &lt;STRONG&gt;start&lt;/STRONG&gt; eval&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:22:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/How-can-I-set-a-report-to-run-that-includes-events-from-1-or-3/m-p/371825#M6369</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2020-09-29T15:22:56Z</dc:date>
    </item>
    <item>
      <title>Re: How can I set a report to run that includes events from 1 or 3 days prior based on the current day of the week?</title>
      <link>https://community.splunk.com/t5/Reporting/How-can-I-set-a-report-to-run-that-includes-events-from-1-or-3/m-p/371826#M6370</link>
      <description>&lt;P&gt;Very strange. Now I've got nothing....  But the formats are matching..&lt;BR /&gt;
....&lt;/P&gt;</description>
      <pubDate>Wed, 16 Aug 2017 19:13:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/How-can-I-set-a-report-to-run-that-includes-events-from-1-or-3/m-p/371826#M6370</guid>
      <dc:creator>mumblingsages</dc:creator>
      <dc:date>2017-08-16T19:13:42Z</dc:date>
    </item>
    <item>
      <title>Re: How can I set a report to run that includes events from 1 or 3 days prior based on the current day of the week?</title>
      <link>https://community.splunk.com/t5/Reporting/How-can-I-set-a-report-to-run-that-includes-events-from-1-or-3/m-p/371827#M6371</link>
      <description>&lt;P&gt;cmerriman... That seems to have done the trick!!&lt;/P&gt;

&lt;P&gt;Thank you both!!&lt;/P&gt;</description>
      <pubDate>Wed, 16 Aug 2017 19:17:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/How-can-I-set-a-report-to-run-that-includes-events-from-1-or-3/m-p/371827#M6371</guid>
      <dc:creator>mumblingsages</dc:creator>
      <dc:date>2017-08-16T19:17:36Z</dc:date>
    </item>
  </channel>
</rss>

