<?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: search time range in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/search-time-range/m-p/58581#M14357</link>
    <description>&lt;P&gt;feel free to mark it as answered.&lt;/P&gt;</description>
    <pubDate>Tue, 10 Sep 2013 13:43:04 GMT</pubDate>
    <dc:creator>kristian_kolb</dc:creator>
    <dc:date>2013-09-10T13:43:04Z</dc:date>
    <item>
      <title>search time range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-time-range/m-p/58576#M14352</link>
      <description>&lt;P&gt;I need to have a search that uses:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="pt_app_siebel" SWEMethod="ReconfigureCXProd" starttime=9/6/2013:00:00:00 latest=now date_wday=monday date_hour=22 | ....
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But what I need is that the &lt;CODE&gt;date_wday&lt;/CODE&gt; and &lt;CODE&gt;date_hour&lt;/CODE&gt; to be determined by the current time. Is there any way to include &lt;CODE&gt;eval wday=strftime(now(),"%w")&lt;/CODE&gt; before the end of the time range definition?&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2013 08:40:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-time-range/m-p/58576#M14352</guid>
      <dc:creator>TiagoMatos</dc:creator>
      <dc:date>2013-09-10T08:40:42Z</dc:date>
    </item>
    <item>
      <title>Re: search time range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-time-range/m-p/58577#M14353</link>
      <description>&lt;P&gt;Hi Tiago - just to clarify, assuming this search is run at 9:55PM on a Thurday night, you want to show all results since 9/6/2013 that happened on a Wednesday between 21:00 &amp;amp; 22:00?&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2013 10:38:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-time-range/m-p/58577#M14353</guid>
      <dc:creator>rturk</dc:creator>
      <dc:date>2013-09-10T10:38:45Z</dc:date>
    </item>
    <item>
      <title>Re: search time range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-time-range/m-p/58578#M14354</link>
      <description>&lt;P&gt;No assuming that the search is run at 9:55PM on Thursday, I want it to show all results from 9/6/2013 till now, and that were on Mondays, and at 21h-22h. THE POINT IS, I NEED TO USE THE now() in date_monday. I just can't make it happen&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2013 12:46:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-time-range/m-p/58578#M14354</guid>
      <dc:creator>TiagoMatos</dc:creator>
      <dc:date>2013-09-10T12:46:07Z</dc:date>
    </item>
    <item>
      <title>Re: search time range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-time-range/m-p/58579#M14355</link>
      <description>&lt;P&gt;You can do that in a subsearch, where the sole purpose of the subsearch is to play around with &lt;CODE&gt;now()&lt;/CODE&gt;, so that it can return valid earliest/latest values to the outer search. Since I still do not really understand your requirement, the example below illustrates how you can ensure that on Mondays you'll get logs covering the weekend, but on other days you'll only get yesterdays logs. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=blah [search * | head 1 | eval earliest=if(date_wday=monday,"-3d@d", "-1d@d")| return earliest] | rest_of_search
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope this helps,&lt;/P&gt;

&lt;P&gt;/K&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2013 13:06:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-time-range/m-p/58579#M14355</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-09-10T13:06:12Z</dc:date>
    </item>
    <item>
      <title>Re: search time range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-time-range/m-p/58580#M14356</link>
      <description>&lt;P&gt;ALthough this is not what I asked exactly, it helped me a lot! My problem is solved! THANKS!&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2013 13:35:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-time-range/m-p/58580#M14356</guid>
      <dc:creator>TiagoMatos</dc:creator>
      <dc:date>2013-09-10T13:35:45Z</dc:date>
    </item>
    <item>
      <title>Re: search time range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-time-range/m-p/58581#M14357</link>
      <description>&lt;P&gt;feel free to mark it as answered.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2013 13:43:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-time-range/m-p/58581#M14357</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-09-10T13:43:04Z</dc:date>
    </item>
  </channel>
</rss>

