<?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 we specify same day last week in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-do-we-specify-same-day-last-week/m-p/97189#M97471</link>
    <description>&lt;P&gt;&lt;STRONG&gt;Comparing week-over-week results used to a pain in Splunk, with complex date calculations. No more.  Now there is a better way.&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;I wrote a convenient search command called "&lt;A href="http://apps.splunk.com/app/1645/"&gt;timewrap&lt;/A&gt;" that does it all, for arbitrary time periods.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | timechart count span=1h | timewrap w 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;That's it!&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;If you want to limit it to a specific day of the week, add: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | where strftime(_time, "%A") == "Wednesday"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;A href="http://apps.splunk.com/app/1645/"&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/A&gt;&lt;A href="http://apps.splunk.com/app/1645/" target="test_blank"&gt;http://apps.splunk.com/app/1645/&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 06 Dec 2013 21:31:43 GMT</pubDate>
    <dc:creator>carasso</dc:creator>
    <dc:date>2013-12-06T21:31:43Z</dc:date>
    <item>
      <title>How do we specify same day last week</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-we-specify-same-day-last-week/m-p/97186#M97468</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;i want to compare the traffic from today to the traffic from the same day a week back. &lt;/P&gt;

&lt;P&gt;in the time range i have -7d@h in the from filed and left empty in the to field. Also my query is like this ....| stats count by date_hour&lt;/P&gt;

&lt;P&gt;I don't think i am getting right stats. When i verified the same search query using custom time frame (for the same day last week) i am getting different counts. Any suggestions? &lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2013 03:16:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-we-specify-same-day-last-week/m-p/97186#M97468</guid>
      <dc:creator>xvxt006</dc:creator>
      <dc:date>2013-04-17T03:16:58Z</dc:date>
    </item>
    <item>
      <title>Re: How do we specify same day last week</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-we-specify-same-day-last-week/m-p/97187#M97469</link>
      <description>&lt;P&gt;well, &lt;CODE&gt;date_hour&lt;/CODE&gt; can be wrong! Especially if you're pulling logs from more than one TZ. &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;_time&lt;/CODE&gt; gets the value adjusted for TZ - what you see to the left of each event.&lt;BR /&gt;
&lt;CODE&gt;date_hour&lt;/CODE&gt; is the hour from within the event itself.&lt;/P&gt;

&lt;P&gt;With &lt;CODE&gt;_time&lt;/CODE&gt; you can make searches like "what happened in the last 15 mins, across all timezones"&lt;BR /&gt;
With &lt;CODE&gt;date_*&lt;/CODE&gt; you can with a single search that asks questions like "who was logging on after 8.00, in their respective TZ". (Dont forget to use a wide enough timespan in the search though).  &lt;/P&gt;

&lt;P&gt;Other than that, have you looked at the DeploymentMonitor app. It contains searches that compare statistics for 'now' and 'same day/hour last week'. You could possibly gain some insights from looking at them.&lt;/P&gt;

&lt;P&gt;Also, there is a blog post on the subject;&lt;/P&gt;

&lt;P&gt;&lt;A href="http://blogs.splunk.com/2012/02/19/compare-two-time-ranges-in-one-report/"&gt;http://blogs.splunk.com/2012/02/19/compare-two-time-ranges-in-one-report/&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Hope this helps,&lt;/P&gt;

&lt;P&gt;Kristian&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2013 04:41:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-we-specify-same-day-last-week/m-p/97187#M97469</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-04-17T04:41:46Z</dc:date>
    </item>
    <item>
      <title>Re: How do we specify same day last week</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-we-specify-same-day-last-week/m-p/97188#M97470</link>
      <description>&lt;P&gt;Thank you Kristian for your help. This is very useful.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2013 14:15:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-we-specify-same-day-last-week/m-p/97188#M97470</guid>
      <dc:creator>xvxt006</dc:creator>
      <dc:date>2013-04-17T14:15:03Z</dc:date>
    </item>
    <item>
      <title>Re: How do we specify same day last week</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-we-specify-same-day-last-week/m-p/97189#M97471</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Comparing week-over-week results used to a pain in Splunk, with complex date calculations. No more.  Now there is a better way.&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;I wrote a convenient search command called "&lt;A href="http://apps.splunk.com/app/1645/"&gt;timewrap&lt;/A&gt;" that does it all, for arbitrary time periods.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | timechart count span=1h | timewrap w 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;That's it!&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;If you want to limit it to a specific day of the week, add: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | where strftime(_time, "%A") == "Wednesday"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;A href="http://apps.splunk.com/app/1645/"&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/A&gt;&lt;A href="http://apps.splunk.com/app/1645/" target="test_blank"&gt;http://apps.splunk.com/app/1645/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2013 21:31:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-we-specify-same-day-last-week/m-p/97189#M97471</guid>
      <dc:creator>carasso</dc:creator>
      <dc:date>2013-12-06T21:31:43Z</dc:date>
    </item>
    <item>
      <title>Re: How do we specify same day last week</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-we-specify-same-day-last-week/m-p/564439#M100499</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6332"&gt;@kristian_kolb&lt;/a&gt;&amp;nbsp;Suppose we want splunk to evaluate yesterday's day on its own and we dont mention specific day of the week like "Wednesday"&amp;nbsp; and then use yesterday's day of week to compare data with same day of week for last 2 weeks, how we can achieve that?&lt;/P&gt;</description>
      <pubDate>Mon, 23 Aug 2021 22:25:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-we-specify-same-day-last-week/m-p/564439#M100499</guid>
      <dc:creator>MayankChandra</dc:creator>
      <dc:date>2021-08-23T22:25:58Z</dc:date>
    </item>
  </channel>
</rss>

