<?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 to create a week over week chart comparison from current time in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-week-over-week-chart-comparison-from-current/m-p/44334#M10455</link>
    <description>&lt;P&gt;And it isn't showing up on a fancy chart like in the examples:&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;</description>
    <pubDate>Sat, 25 Aug 2012 00:41:39 GMT</pubDate>
    <dc:creator>craighawk</dc:creator>
    <dc:date>2012-08-25T00:41:39Z</dc:date>
    <item>
      <title>How to create a week over week chart comparison from current time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-week-over-week-chart-comparison-from-current/m-p/44332#M10453</link>
      <description>&lt;P&gt;index=data du=&lt;ALL&gt; host=&lt;ALL&gt; | timechart count by opp&lt;/ALL&gt;&lt;/ALL&gt;&lt;/P&gt;

&lt;P&gt;or&lt;/P&gt;

&lt;P&gt;index=data du=&lt;ALL&gt; host=&lt;ALL&gt; &lt;/ALL&gt;&lt;/ALL&gt;&lt;/P&gt;

&lt;P&gt;I am useing version 4.3.2, build 123586&lt;/P&gt;

&lt;P&gt;I have been trying to figure out how to make a chart with the current day/time compared to one week ago same day and time.&lt;/P&gt;

&lt;P&gt;I have left out the dozens of variations I've tried to spare other newbies like myself the frustration of working through them only to find they didn't work.&lt;/P&gt;

&lt;P&gt;** I used "all" since the asterisk wasn't being displayed.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Aug 2012 23:09:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-week-over-week-chart-comparison-from-current/m-p/44332#M10453</guid>
      <dc:creator>craighawk</dc:creator>
      <dc:date>2012-08-24T23:09:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a week over week chart comparison from current time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-week-over-week-chart-comparison-from-current/m-p/44333#M10454</link>
      <description>&lt;P&gt;Getting strange output and no legend stating "today" and "yesterday".&lt;/P&gt;

&lt;P&gt;index=data du=* earliest=-0d@d latest=now | multikv | eval ReportKey="today" | append [search index="data" earliest=-7d@d latest=-6d@d | multikv | eval ReportKey="same day last week" | eval _time=_time+60*60*24*7] | timechart span=60m avg(du) by ReportKey &lt;/P&gt;

&lt;P&gt;** 'du' values are different integers.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:20:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-week-over-week-chart-comparison-from-current/m-p/44333#M10454</guid>
      <dc:creator>craighawk</dc:creator>
      <dc:date>2020-09-28T12:20:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a week over week chart comparison from current time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-week-over-week-chart-comparison-from-current/m-p/44334#M10455</link>
      <description>&lt;P&gt;And it isn't showing up on a fancy chart like in the examples:&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;</description>
      <pubDate>Sat, 25 Aug 2012 00:41:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-week-over-week-chart-comparison-from-current/m-p/44334#M10455</guid>
      <dc:creator>craighawk</dc:creator>
      <dc:date>2012-08-25T00:41:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a week over week chart comparison from current time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-week-over-week-chart-comparison-from-current/m-p/44335#M10456</link>
      <description>&lt;P&gt;How does your data look? If you already have "du" -field in it I don't see any need for "multikv" -commands in your search. Also in your original example you were counting number of events by opp(?) but then you have changed it to be hourly average of du -field. Was this done on purpose? Does your search/charting work for today and week-ago if you run them separately?&lt;/P&gt;</description>
      <pubDate>Sun, 26 Aug 2012 09:13:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-week-over-week-chart-comparison-from-current/m-p/44335#M10456</guid>
      <dc:creator>kallu</dc:creator>
      <dc:date>2012-08-26T09:13:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a week over week chart comparison from current time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-week-over-week-chart-comparison-from-current/m-p/44336#M10457</link>
      <description>&lt;P&gt;Something like this maybe, it doesn't take into account timezone changes, leap years etc.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal sourcetype=splunkd eps &amp;gt; 0 | addinfo 
| eval date_wnum=strftime(_time, "%V") 
| eval date_wnum_now=strftime(info_max_time, "%V")
| eval _time=_time+(date_wnum_now-date_wnum)*86400*7  
| eval date_wnum=if(date_wnum==date_wnum_now,"This week",(date_wnum_now-date_wnum)." weeks ago")
| bin _time span=1h
| chart avg(eps) over _time by date_wnum
| makecontinuous _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It works by shifting previous weeks data into this week, but tagging it as "X weeks ago"&lt;BR /&gt;
I use chart instead of timechart because timechart would plot the entire date range in the search, but because everything is timeshifted, all the data would be crammed at the end of the chart.&lt;/P&gt;

&lt;P&gt;You need | makecontinuous _time&lt;BR /&gt;&lt;BR /&gt;
So that the JSchart prints reasonable 'time' values, instead of XML stype time values.&lt;/P&gt;</description>
      <pubDate>Sun, 26 Aug 2012 18:02:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-week-over-week-chart-comparison-from-current/m-p/44336#M10457</guid>
      <dc:creator>jonuwz</dc:creator>
      <dc:date>2012-08-26T18:02:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a week over week chart comparison from current time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-week-over-week-chart-comparison-from-current/m-p/44337#M10458</link>
      <description>&lt;P&gt;Great, that looks like it works!  Thanks a lot.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Aug 2012 21:26:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-week-over-week-chart-comparison-from-current/m-p/44337#M10458</guid>
      <dc:creator>craighawk</dc:creator>
      <dc:date>2012-08-27T21:26:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a week over week chart comparison from current time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-week-over-week-chart-comparison-from-current/m-p/44338#M10459</link>
      <description>&lt;P&gt;Hello Kallu, I was able to get my question answered. This worked for me:&lt;/P&gt;

&lt;P&gt;index=_internal sourcetype=splunkd eps &amp;gt; 0 | addinfo &lt;BR /&gt;
| eval date_wnum=strftime(_time, "%V") &lt;BR /&gt;
| eval date_wnum_now=strftime(info_max_time, "%V")&lt;BR /&gt;
| eval _time=_time+(date_wnum_now-date_wnum)*86400*7&lt;BR /&gt;&lt;BR /&gt;
| eval date_wnum=if(date_wnum==date_wnum_now,"This week",(date_wnum_now-date_wnum)." weeks ago")&lt;BR /&gt;
| bin _time span=1h&lt;BR /&gt;
| chart avg(eps) over _time by date_wnum&lt;BR /&gt;
| makecontinuous _time&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:20:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-week-over-week-chart-comparison-from-current/m-p/44338#M10459</guid>
      <dc:creator>craighawk</dc:creator>
      <dc:date>2020-09-28T12:20:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a week over week chart comparison from current time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-week-over-week-chart-comparison-from-current/m-p/44339#M10460</link>
      <description>&lt;P&gt;How would you achieve the same results but on the same x axis? So that the X axis just had the day of the week -&amp;gt; mon,tues,weds   &lt;/P&gt;

&lt;P&gt;and then have numerous lines for this week and 1 week ago?&lt;/P&gt;

&lt;P&gt;That would be a lot better.&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2013 14:16:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-week-over-week-chart-comparison-from-current/m-p/44339#M10460</guid>
      <dc:creator>chris_lewis</dc:creator>
      <dc:date>2013-05-16T14:16:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a week over week chart comparison from current time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-week-over-week-chart-comparison-from-current/m-p/44340#M10461</link>
      <description>&lt;P&gt;An old thread, but Splunk has now a better way to do this, using &lt;STRONG&gt;Timewrap&lt;/STRONG&gt;&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Timewrap"&gt;https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Timewrap&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal sourcetype=splunkd eps&amp;gt;0 earliest=-1mon latest=now
| timechart avg(eps) span=1h 
| timewrap 1w
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 06 Mar 2017 08:12:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-week-over-week-chart-comparison-from-current/m-p/44340#M10461</guid>
      <dc:creator>lakromani</dc:creator>
      <dc:date>2017-03-06T08:12:09Z</dc:date>
    </item>
  </channel>
</rss>

