<?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: Relative and Exact Time in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Relative-and-Exact-Time/m-p/489209#M140277</link>
    <description>&lt;P&gt;The gap in the first graph is expected since events during that time have been filtered out.&lt;BR /&gt;
The two searches with missing results is normal since the date_time field used in the final &lt;CODE&gt;where&lt;/CODE&gt; statement is not available after &lt;CODE&gt;timechart&lt;/CODE&gt;.&lt;BR /&gt;
The last search filters out all events except those between 0655 and 2200 today.&lt;/P&gt;</description>
    <pubDate>Thu, 30 Apr 2020 17:45:55 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2020-04-30T17:45:55Z</dc:date>
    <item>
      <title>Relative and Exact Time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Relative-and-Exact-Time/m-p/489202#M140270</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;
I am using these two commands at the end of my search, and it works.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;| timewrap d&lt;BR /&gt;
| where _time &amp;gt;= relative_time(now(), "-1h@h-10m") AND _time &amp;lt;= relative_time(now(), "-1h@h+10m")&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;What I am looking to do (this is pseudo-code) &lt;STRONG&gt;| where _time &amp;gt;= 6:00 am AND _time &amp;lt;=9:59 pm&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;I want to set a time chart for the same time range every day. Hence, the &lt;STRONG&gt;| timewrap d&lt;/STRONG&gt;.&lt;/P&gt;

&lt;P&gt;Thanks, stay safe and healthy, and God bless,&lt;BR /&gt;
Genesius&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 05:15:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Relative-and-Exact-Time/m-p/489202#M140270</guid>
      <dc:creator>genesiusj</dc:creator>
      <dc:date>2020-09-30T05:15:25Z</dc:date>
    </item>
    <item>
      <title>Re: Relative and Exact Time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Relative-and-Exact-Time/m-p/489203#M140271</link>
      <description>&lt;P&gt;Try this.  The "@d+6h" construct means "6 hours after 0:00 today" or 6am.  Similarly, "@d+22h" mean 22 hours after 0:00 or 10pm.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| where _time &amp;gt;= relative_time(now(), "@d+6h") AND _time &amp;lt; relative_time(now(), "@d+22h")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 29 Apr 2020 18:32:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Relative-and-Exact-Time/m-p/489203#M140271</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-04-29T18:32:19Z</dc:date>
    </item>
    <item>
      <title>Re: Relative and Exact Time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Relative-and-Exact-Time/m-p/489204#M140272</link>
      <description>&lt;P&gt;@richgalloway &lt;BR /&gt;
Perfect. Simple answer. Couldn't see it.&lt;BR /&gt;
Thanks, stay safe and healthy, and God bless,&lt;BR /&gt;
Genesius&lt;/P&gt;</description>
      <pubDate>Wed, 29 Apr 2020 18:50:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Relative-and-Exact-Time/m-p/489204#M140272</guid>
      <dc:creator>genesiusj</dc:creator>
      <dc:date>2020-04-29T18:50:27Z</dc:date>
    </item>
    <item>
      <title>Re: Relative and Exact Time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Relative-and-Exact-Time/m-p/489205#M140273</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt; &lt;BR /&gt;
I'm not taking away the kudos; however, there is one issue.&lt;/P&gt;

&lt;P&gt;Your solution works for previous days; but not for the current day. I just ran the search (3:55 pm). For each of the 7 days, it is graphing 6 am to 3:55 pm. The last 6 hours of the previous 6 days is not graphed.&lt;/P&gt;

&lt;P&gt;This is one of the modifications I made&lt;BR /&gt;
*&lt;EM&gt;| where (_time &amp;gt;= relative_time(now(), "-1d@d+6h") AND _time &amp;lt;= relative_time(now(), "-1d@d+22h")) OR (_time &amp;gt;= relative_time(now(), "@d+6h") AND _time &amp;lt;= relative_time(now(), "@d+22h"))&lt;BR /&gt;
*&lt;/EM&gt;&lt;BR /&gt;
but the displayed "dead space (10 pm to 6 am).&lt;/P&gt;

&lt;P&gt;Thanks, stay safe and healthy, and God bless,&lt;BR /&gt;
Genesius&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 05:15:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Relative-and-Exact-Time/m-p/489205#M140273</guid>
      <dc:creator>genesiusj</dc:creator>
      <dc:date>2020-09-30T05:15:27Z</dc:date>
    </item>
    <item>
      <title>Re: Relative and Exact Time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Relative-and-Exact-Time/m-p/489206#M140274</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt; &lt;BR /&gt;
When I use&lt;BR /&gt;
&lt;STRONG&gt;| where (_time &amp;gt;= relative_time(now(), "-1d@d+6h") AND _time &amp;lt;= relative_time(now(), "-1d@d+22h"))&lt;/STRONG&gt;&lt;BR /&gt;
I now lose all of today's and the previous 6 days time from 6 am to the time the search is run.&lt;BR /&gt;
Thanks, stay safe and healthy, and God bless,&lt;BR /&gt;
Genesius&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 05:16:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Relative-and-Exact-Time/m-p/489206#M140274</guid>
      <dc:creator>genesiusj</dc:creator>
      <dc:date>2020-09-30T05:16:12Z</dc:date>
    </item>
    <item>
      <title>Re: Relative and Exact Time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Relative-and-Exact-Time/m-p/489207#M140275</link>
      <description>&lt;P&gt;The &lt;CODE&gt;relative_time&lt;/CODE&gt; example I gave you will only work for the current day.  For previous days, we'll have to replace &lt;CODE&gt;now()&lt;/CODE&gt; with something else.&lt;/P&gt;

&lt;P&gt;Here's another idea.  If you have the 'date_hour' field in your events you could use &lt;CODE&gt;| where (date_hour &amp;gt;= 6 AND date_hour &amp;lt;= 21)&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 05:16:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Relative-and-Exact-Time/m-p/489207#M140275</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-09-30T05:16:15Z</dc:date>
    </item>
    <item>
      <title>Re: Relative and Exact Time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Relative-and-Exact-Time/m-p/489208#M140276</link>
      <description>&lt;P&gt;@richgalloway &lt;BR /&gt;
Please let me know if the pic is not viewable.&lt;BR /&gt;
&lt;IMG src="https://i.imgur.com/RQE5iIP.png" alt="examples" /&gt;&lt;BR /&gt;
Thanks, stay safe and healthy, and God bless,&lt;BR /&gt;
Genesius&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2020 16:57:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Relative-and-Exact-Time/m-p/489208#M140276</guid>
      <dc:creator>genesiusj</dc:creator>
      <dc:date>2020-04-30T16:57:34Z</dc:date>
    </item>
    <item>
      <title>Re: Relative and Exact Time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Relative-and-Exact-Time/m-p/489209#M140277</link>
      <description>&lt;P&gt;The gap in the first graph is expected since events during that time have been filtered out.&lt;BR /&gt;
The two searches with missing results is normal since the date_time field used in the final &lt;CODE&gt;where&lt;/CODE&gt; statement is not available after &lt;CODE&gt;timechart&lt;/CODE&gt;.&lt;BR /&gt;
The last search filters out all events except those between 0655 and 2200 today.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2020 17:45:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Relative-and-Exact-Time/m-p/489209#M140277</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-04-30T17:45:55Z</dc:date>
    </item>
    <item>
      <title>Re: Relative and Exact Time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Relative-and-Exact-Time/m-p/489210#M140278</link>
      <description>&lt;P&gt;@richgalloway &lt;BR /&gt;
But with the last example, I'm still not getting the results from &lt;STRONG&gt;now&lt;/STRONG&gt; to &lt;STRONG&gt;2200&lt;/STRONG&gt; for the other &lt;STRONG&gt;6 days&lt;/STRONG&gt;. Is it possible to get that missing data? Maybe you've provided me an answer earlier in the post and I missed it. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
Thanks, stay safe and healthy, and God bless,&lt;BR /&gt;
Genesius&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2020 17:53:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Relative-and-Exact-Time/m-p/489210#M140278</guid>
      <dc:creator>genesiusj</dc:creator>
      <dc:date>2020-04-30T17:53:55Z</dc:date>
    </item>
    <item>
      <title>Re: Relative and Exact Time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Relative-and-Exact-Time/m-p/489211#M140279</link>
      <description>&lt;P&gt;The text in the graphs are too small to read so I can't see what intervals are being reported.&lt;BR /&gt;
I think we may have covered this already.  The last line of the last search tells Splunk to show only those events that occurred between 0655 and 2200 &lt;EM&gt;today&lt;/EM&gt;.&lt;BR /&gt;
The first search appears to be the most correct.  Is the time window set for 7 days?&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2020 18:21:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Relative-and-Exact-Time/m-p/489211#M140279</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-04-30T18:21:43Z</dc:date>
    </item>
    <item>
      <title>Re: Relative and Exact Time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Relative-and-Exact-Time/m-p/489212#M140280</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;The text in the graphs are too small to read so I can't see what intervals are being reported. The last line of the last search tells Splunk to show only those events that occurred between 0655 and 2200 today.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;It doesn't. The results are only from 0655 to ~1230 when the search was run. All results from 1230 to 2200 are not displayed.&lt;/P&gt;

&lt;P&gt;Thanks, stay safe and healthy, and God bless,&lt;BR /&gt;
Genesius&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2020 18:47:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Relative-and-Exact-Time/m-p/489212#M140280</guid>
      <dc:creator>genesiusj</dc:creator>
      <dc:date>2020-04-30T18:47:48Z</dc:date>
    </item>
    <item>
      <title>Re: Relative and Exact Time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Relative-and-Exact-Time/m-p/489213#M140281</link>
      <description>&lt;P&gt;If it's only 1230 now, then there should be no events between 1230 and 2200 today.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2020 19:23:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Relative-and-Exact-Time/m-p/489213#M140281</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-04-30T19:23:21Z</dc:date>
    </item>
    <item>
      <title>Re: Relative and Exact Time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Relative-and-Exact-Time/m-p/489214#M140282</link>
      <description>&lt;P&gt;@richgalloway &lt;BR /&gt;
But why can't I get the 1230 to 2200 for the other 6 days?&lt;BR /&gt;
Thanks, stay safe and healthy, and God bless,&lt;BR /&gt;
Genesius&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2020 19:27:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Relative-and-Exact-Time/m-p/489214#M140282</guid>
      <dc:creator>genesiusj</dc:creator>
      <dc:date>2020-04-30T19:27:05Z</dc:date>
    </item>
    <item>
      <title>Re: Relative and Exact Time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Relative-and-Exact-Time/m-p/489215#M140283</link>
      <description>&lt;P&gt;I don't understand why that's happening.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2020 19:34:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Relative-and-Exact-Time/m-p/489215#M140283</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-04-30T19:34:07Z</dc:date>
    </item>
    <item>
      <title>Re: Relative and Exact Time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Relative-and-Exact-Time/m-p/489216#M140284</link>
      <description>&lt;P&gt;@richgalloway &lt;BR /&gt;
At least we are on the same page now. Thanks for your help. Your solution is very helpful because the tech team can compare the current timeframe from today with the previous 6 days for that timeframe.&lt;BR /&gt;
I'll keep plugging away.&lt;BR /&gt;
Thanks, stay safe and healthy, and God bless,&lt;BR /&gt;
Genesius&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2020 20:28:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Relative-and-Exact-Time/m-p/489216#M140284</guid>
      <dc:creator>genesiusj</dc:creator>
      <dc:date>2020-04-30T20:28:41Z</dc:date>
    </item>
    <item>
      <title>Re: Relative and Exact Time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Relative-and-Exact-Time/m-p/489217#M140285</link>
      <description>&lt;P&gt;@richgalloway &lt;BR /&gt;
A colleague found the solution.&lt;BR /&gt;
Adding a latest field-value to the end of the |AND command &lt;CODE&gt;AND date_hour&amp;amp;gt;=6 AND date_hour&amp;amp;lt;=22 latest=+1d@d&lt;/CODE&gt;(see complete code below). Note: We also added some code to clean up the names of the series.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index IN (oit_catalina,dol_solarisevents)
    AND source=/opt/as7/domains/domain1/dolapps1/logs/access
    AND sourcetype=access_combined
    AND host=nas3*
    AND method IN (GET,POST)
    AND date_hour&amp;amp;gt;=6 AND date_hour&amp;amp;lt;=22 latest=+1d@d
| rex mode=sed field=host "s/.sa.state.nj.us//g" 
| eval certsFiled=case(file="confirm_new.jsp","1") 
| timechart count span=1min
| timewrap d series=short
| where _time &amp;amp;gt;= relative_time(now(), "@d+6h+55min") AND _time &amp;amp;lt;= relative_time(now(), "@d+22h")
| eval colname0 = strftime(relative_time(now(), "@d"),"%D-%a")
| eval colname1 = strftime(relative_time(now(), "-d@d"), "%D-%a")
| eval colname2 = strftime(relative_time(now(), "-2d@d"), "%D-%a")
| eval colname3 = strftime(relative_time(now(), "-3d@d"),"%D-%a")
| eval colname4 = strftime(relative_time(now(), "-4d@d"), "%D-%a")
| eval colname5 = strftime(relative_time(now(), "-5d@d"), "%D-%a")
| eval colname6 = strftime(relative_time(now(), "-6d@d"), "%D-%a")
| eval {colname0} = s0
| eval {colname1} = s1
| eval {colname2} = s2
| eval {colname3} = s3
| eval {colname4} = s4
| eval {colname5} = s5
| eval {colname6} = s6
| fields - s* col* 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks for all your help.&lt;BR /&gt;
Stay safe and healthy, you and yours.&lt;BR /&gt;
God bless,&lt;BR /&gt;
Genesius&lt;/P&gt;</description>
      <pubDate>Sun, 10 May 2020 02:43:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Relative-and-Exact-Time/m-p/489217#M140285</guid>
      <dc:creator>genesiusj</dc:creator>
      <dc:date>2020-05-10T02:43:10Z</dc:date>
    </item>
  </channel>
</rss>

