<?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 I modify the span for timechart to match a chart I'm defining with a time range of &amp;quot;last 7 days&amp;quot;? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-modify-the-span-for-timechart-to-match-a-chart-I-m/m-p/285283#M86307</link>
    <description>&lt;P&gt;I am having the same concern&lt;/P&gt;</description>
    <pubDate>Thu, 19 Sep 2019 15:00:56 GMT</pubDate>
    <dc:creator>k_malik</dc:creator>
    <dc:date>2019-09-19T15:00:56Z</dc:date>
    <item>
      <title>How do I modify the span for timechart to match a chart I'm defining with a time range of "last 7 days"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-modify-the-span-for-timechart-to-match-a-chart-I-m/m-p/285267#M86291</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;

&lt;P&gt;I've been playing around with the &lt;CODE&gt;timechart&lt;/CODE&gt; command and spanning, however, there is an issue I'm having when I'm trying to use it to match a chart I'm defining with the &lt;CODE&gt;last 7 days&lt;/CODE&gt; timespan.&lt;/P&gt;

&lt;P&gt;I'm trying to have timechart span in such as way that its current period is the same as the &lt;CODE&gt;last 7 days&lt;/CODE&gt; command, while it is able to go back X number of these periods to build a trend off of. I've been unable to find a combination of span variables and time offsets that matches the time snap of the &lt;CODE&gt;last 7 days&lt;/CODE&gt; window. &lt;/P&gt;

&lt;P&gt;Has anyone with experience doing something like this have a solution that allows you to more precisely define the time snapping?&lt;/P&gt;

&lt;P&gt;Edit:&lt;BR /&gt;
Apologies for the difficulty in understanding this question, I've included the below to help explain what I am getting at:&lt;/P&gt;

&lt;P&gt;When I use &lt;CODE&gt;timechart count span=7d&lt;/CODE&gt;, I receive the following output:&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="7 Day Span"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/1454iEBF08D69C4E90384/image-size/large?v=v2&amp;amp;px=999" role="button" title="7 Day Span" alt="7 Day Span" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;However, when I use &lt;CODE&gt;time chart count span=1d&lt;/CODE&gt;, I receive the following output:&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="1 Day Span"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/1455i2F14B39AF9F1A834/image-size/large?v=v2&amp;amp;px=999" role="button" title="1 Day Span" alt="1 Day Span" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;I've marked above in Red the dates which makeup 2016-06-04 in output with the larger span, and so on. What I'm looking for is a way to reverse that calculation, so that instead of starting at the 'earliest' date and making 7 day spans, I'd like it to start at the 'latest' date and make the spans going backwards. &lt;/P&gt;

&lt;P&gt;I hope this has made it more clear!&lt;/P&gt;

&lt;P&gt;Second edit:&lt;/P&gt;

&lt;P&gt;I've attempted to do the double binning solution MuS provided, however the bins are still being created from earliest to latest, instead of latest to earliest which is my desired outcome. &lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2016 13:55:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-modify-the-span-for-timechart-to-match-a-chart-I-m/m-p/285267#M86291</guid>
      <dc:creator>goodsellt</dc:creator>
      <dc:date>2016-06-01T13:55:04Z</dc:date>
    </item>
    <item>
      <title>Re: How do I modify the span for timechart to match a chart I'm defining with a time range of "last 7 days"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-modify-the-span-for-timechart-to-match-a-chart-I-m/m-p/285268#M86292</link>
      <description>&lt;P&gt;What is wrong with &lt;CODE&gt;span=7d&lt;/CODE&gt;?&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2016 14:38:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-modify-the-span-for-timechart-to-match-a-chart-I-m/m-p/285268#M86292</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-06-01T14:38:56Z</dc:date>
    </item>
    <item>
      <title>Re: How do I modify the span for timechart to match a chart I'm defining with a time range of "last 7 days"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-modify-the-span-for-timechart-to-match-a-chart-I-m/m-p/285269#M86293</link>
      <description>&lt;P&gt;Apologies but I've read your question twice but I still don't understand it... &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt; Can you maybe add screenshots and search commands and earliest/latests etc to explain what you get and what you want again?&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2016 12:21:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-modify-the-span-for-timechart-to-match-a-chart-I-m/m-p/285269#M86293</guid>
      <dc:creator>gabriel_vasseur</dc:creator>
      <dc:date>2016-06-02T12:21:59Z</dc:date>
    </item>
    <item>
      <title>Re: How do I modify the span for timechart to match a chart I'm defining with a time range of "last 7 days"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-modify-the-span-for-timechart-to-match-a-chart-I-m/m-p/285270#M86294</link>
      <description>&lt;P&gt;I've updated the original post with some clarifications I hope should help.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jun 2016 22:42:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-modify-the-span-for-timechart-to-match-a-chart-I-m/m-p/285270#M86294</guid>
      <dc:creator>goodsellt</dc:creator>
      <dc:date>2016-06-06T22:42:36Z</dc:date>
    </item>
    <item>
      <title>Re: How do I modify the span for timechart to match a chart I'm defining with a time range of "last 7 days"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-modify-the-span-for-timechart-to-match-a-chart-I-m/m-p/285271#M86295</link>
      <description>&lt;P&gt;Hi goodsellt,&lt;/P&gt;

&lt;P&gt;Splunk by default shows the earliest events at top like in this run everywhere command. &lt;BR /&gt;
If you want to reverse the order simply add a &lt;CODE&gt;|reverse&lt;/CODE&gt; or &lt;CODE&gt;| sort - _time&lt;/CODE&gt; at the end of your search:&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/1450iE6821248FA2B7098/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Update:&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Finally I understand what your question is all about &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; So, if you want to such kind of time spanning, you must do some double bucketing of &lt;CODE&gt;_time&lt;/CODE&gt;. &lt;/P&gt;

&lt;P&gt;First you will need to get your event by day (For this run everywhere example I used hours but this can be easily changed to days) &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=_internal kb=* kbps=* earliest=-28h@h latest=-1h@h | bin _time span=1h | stats sum(kb) AS perHour by _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will give you results per hour, note the &lt;CODE&gt;latest&lt;/CODE&gt; in the base search - this is how to tell Splunk where to start the second &lt;CODE&gt;_time&lt;/CODE&gt; bucketing. To get the second bucketing starting with the oldest event, we have to use &lt;CODE&gt;reverse&lt;/CODE&gt; (not very efficient I know) and use the time chart against this event set&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| reverse | timechart span=7h values(perHour) AS val_perHour sum(perHour) AS Total
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This time we will use the &lt;CODE&gt;span=7h&lt;/CODE&gt; to group events over 7 hours.&lt;/P&gt;

&lt;P&gt;The final search looks like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal kb=* kbps=* earliest=-28h@h latest=-1h@h 
| bin _time span=1h 
| stats sum(kb) AS perHour by _time 
| reverse 
| timechart span=7h values(perHour) AS val_perHour sum(perHour) AS Total
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And the result is this:&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/1451iA14B6288195F9EE2/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;If you want to take this to the next level and have some kind of dynamic &lt;CODE&gt;span&lt;/CODE&gt; based on the time range picker, check out this answer &lt;A href="https://answers.splunk.com/answers/390574/how-to-create-a-search-that-shows-a-trending-value.html"&gt;https://answers.splunk.com/answers/390574/how-to-create-a-search-that-shows-a-trending-value.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jun 2016 22:52:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-modify-the-span-for-timechart-to-match-a-chart-I-m/m-p/285271#M86295</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2016-06-06T22:52:14Z</dc:date>
    </item>
    <item>
      <title>Re: How do I modify the span for timechart to match a chart I'm defining with a time range of "last 7 days"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-modify-the-span-for-timechart-to-match-a-chart-I-m/m-p/285272#M86296</link>
      <description>&lt;P&gt;I see, so the fundamental question is this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;How does Splunk select the endpoints for any window (e.g. which day will be `day 1` and which day will be `day 7` when `span=7d` is specified) and how can one influence this to be different.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This is a good question.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2016 01:41:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-modify-the-span-for-timechart-to-match-a-chart-I-m/m-p/285272#M86296</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-06-07T01:41:54Z</dc:date>
    </item>
    <item>
      <title>Re: How do I modify the span for timechart to match a chart I'm defining with a time range of "last 7 days"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-modify-the-span-for-timechart-to-match-a-chart-I-m/m-p/285273#M86297</link>
      <description>&lt;P&gt;Thanks that's much clearer! Interesting question.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2016 07:19:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-modify-the-span-for-timechart-to-match-a-chart-I-m/m-p/285273#M86297</guid>
      <dc:creator>gabriel_vasseur</dc:creator>
      <dc:date>2016-06-07T07:19:36Z</dc:date>
    </item>
    <item>
      <title>Re: How do I modify the span for timechart to match a chart I'm defining with a time range of "last 7 days"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-modify-the-span-for-timechart-to-match-a-chart-I-m/m-p/285274#M86298</link>
      <description>&lt;P&gt;It would be interesting indeed to know how one can influence the alignment of span. I have monthly graphs with a span of 4h that used to start on the 1st of the month at 0:00, but now that we moved to British Summer Time (GMT+1) they start on the last day of the previous month at 21:00!&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2016 07:23:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-modify-the-span-for-timechart-to-match-a-chart-I-m/m-p/285274#M86298</guid>
      <dc:creator>gabriel_vasseur</dc:creator>
      <dc:date>2016-06-07T07:23:21Z</dc:date>
    </item>
    <item>
      <title>Re: How do I modify the span for timechart to match a chart I'm defining with a time range of "last 7 days"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-modify-the-span-for-timechart-to-match-a-chart-I-m/m-p/285275#M86299</link>
      <description>&lt;P&gt;In your case, you can control this with your user &lt;CODE&gt;Time zone&lt;/CODE&gt; setting.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2016 12:27:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-modify-the-span-for-timechart-to-match-a-chart-I-m/m-p/285275#M86299</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-06-07T12:27:00Z</dc:date>
    </item>
    <item>
      <title>Re: How do I modify the span for timechart to match a chart I'm defining with a time range of "last 7 days"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-modify-the-span-for-timechart-to-match-a-chart-I-m/m-p/285276#M86300</link>
      <description>&lt;P&gt;Thanks for the response!&lt;/P&gt;

&lt;P&gt;However, this only changes the order it is displayed in, versus my desired goal of reversing the order the spans are generated and calculated. &lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2016 13:02:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-modify-the-span-for-timechart-to-match-a-chart-I-m/m-p/285276#M86300</guid>
      <dc:creator>goodsellt</dc:creator>
      <dc:date>2016-06-07T13:02:46Z</dc:date>
    </item>
    <item>
      <title>Re: How do I modify the span for timechart to match a chart I'm defining with a time range of "last 7 days"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-modify-the-span-for-timechart-to-match-a-chart-I-m/m-p/285277#M86301</link>
      <description>&lt;P&gt;aaaah, now I get it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; took me some time to understand it but I think I have the answer somewhere .... pls wait.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2016 21:35:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-modify-the-span-for-timechart-to-match-a-chart-I-m/m-p/285277#M86301</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2016-06-07T21:35:59Z</dc:date>
    </item>
    <item>
      <title>Re: How do I modify the span for timechart to match a chart I'm defining with a time range of "last 7 days"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-modify-the-span-for-timechart-to-match-a-chart-I-m/m-p/285278#M86302</link>
      <description>&lt;P&gt;Update ping, see my answer to get some ideas on how this can be done - cheers, MuS&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jun 2016 02:40:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-modify-the-span-for-timechart-to-match-a-chart-I-m/m-p/285278#M86302</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2016-06-08T02:40:03Z</dc:date>
    </item>
    <item>
      <title>Re: How do I modify the span for timechart to match a chart I'm defining with a time range of "last 7 days"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-modify-the-span-for-timechart-to-match-a-chart-I-m/m-p/285279#M86303</link>
      <description>&lt;P&gt;Hello! I tried out the solution you provided a few ways, however it does not appear that double binning the time affects the starting points for any of the bins. I'm still continuing to have the bins only form from earliest to latest. &lt;/P&gt;</description>
      <pubDate>Wed, 15 Jun 2016 20:47:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-modify-the-span-for-timechart-to-match-a-chart-I-m/m-p/285279#M86303</guid>
      <dc:creator>goodsellt</dc:creator>
      <dc:date>2016-06-15T20:47:26Z</dc:date>
    </item>
    <item>
      <title>Re: How do I modify the span for timechart to match a chart I'm defining with a time range of "last 7 days"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-modify-the-span-for-timechart-to-match-a-chart-I-m/m-p/285280#M86304</link>
      <description>&lt;P&gt;@goodsellt, maybe you should check out the &lt;CODE&gt;start-end&lt;/CODE&gt; option of the &lt;CODE&gt;bin&lt;/CODE&gt; command:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;start-end&amp;gt;
Syntax: start=&amp;lt;num&amp;gt; | end=&amp;lt;num&amp;gt;
Description: Sets the minimum and maximum extents for numerical bins. The data in the field is analyzed and the beginning and ending values are determined. The start and end arguments are used when a span value is not specified.
You can use the start or end arguments only to expand the range, not to shorten the range. For example, if the field represents seconds the values are from 0-59. If you specify a span of 10, then the bins are calculated in increments of 10. The bins are 0-9, 10-19, 20-29, and so forth. If you do not specify a span, but specify end=1000, the bins are calculated based on the actual beginning value and 1000 as the end value.
If you set end=10 and the values are &amp;gt;10, the end argument has no effect.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.4.1/SearchReference/Bin#Bin_options"&gt;http://docs.splunk.com/Documentation/Splunk/6.4.1/SearchReference/Bin#Bin_options&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 19 Jun 2016 21:52:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-modify-the-span-for-timechart-to-match-a-chart-I-m/m-p/285280#M86304</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2016-06-19T21:52:25Z</dc:date>
    </item>
    <item>
      <title>Re: How do I modify the span for timechart to match a chart I'm defining with a time range of "last 7 days"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-modify-the-span-for-timechart-to-match-a-chart-I-m/m-p/285281#M86305</link>
      <description>&lt;P&gt;Hi, I'm also having a similar problem.&lt;/P&gt;

&lt;P&gt;I'm trying to compare &lt;STRONG&gt;count from the past 7 days&lt;/STRONG&gt; vs. &lt;STRONG&gt;count from the past 7 days (7 days ago)&lt;/STRONG&gt;. However, when I look at the totals and compare it with the per day count, it doesn't add up.&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/1452i093AB203D116FF52/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/1453i5C76368547E3D7F4/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jan 2018 23:06:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-modify-the-span-for-timechart-to-match-a-chart-I-m/m-p/285281#M86305</guid>
      <dc:creator>josephinemho</dc:creator>
      <dc:date>2018-01-22T23:06:29Z</dc:date>
    </item>
    <item>
      <title>Re: How do I modify the span for timechart to match a chart I'm defining with a time range of "last 7 days"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-modify-the-span-for-timechart-to-match-a-chart-I-m/m-p/285282#M86306</link>
      <description>&lt;P&gt;hello,&lt;BR /&gt;
I have exactly the same need.&lt;BR /&gt;
Did someone finally come up with a solution ?&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Cyril&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2019 14:37:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-modify-the-span-for-timechart-to-match-a-chart-I-m/m-p/285282#M86306</guid>
      <dc:creator>cgodon</dc:creator>
      <dc:date>2019-09-10T14:37:10Z</dc:date>
    </item>
    <item>
      <title>Re: How do I modify the span for timechart to match a chart I'm defining with a time range of "last 7 days"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-modify-the-span-for-timechart-to-match-a-chart-I-m/m-p/285283#M86307</link>
      <description>&lt;P&gt;I am having the same concern&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2019 15:00:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-modify-the-span-for-timechart-to-match-a-chart-I-m/m-p/285283#M86307</guid>
      <dc:creator>k_malik</dc:creator>
      <dc:date>2019-09-19T15:00:56Z</dc:date>
    </item>
    <item>
      <title>Re: How do I modify the span for timechart to match a chart I'm defining with a time range of "last 7 days"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-modify-the-span-for-timechart-to-match-a-chart-I-m/m-p/514741#M144488</link>
      <description>&lt;P&gt;I faced a similar issue and resolved it by creating an "inverse" timestamp and using that to bucket events on instead of _time. For example:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%" height="45px"&gt;...&amp;nbsp;| eval repoch=relative_time(now(),"+0d@d-1d")&lt;/TD&gt;&lt;TD width="50%" height="45px"&gt;Pick a latest time (I was interested in values upto and including yesterday)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="24px"&gt;| eval retime=repoch-_time&lt;/TD&gt;&lt;TD width="50%" height="24px"&gt;Calculate time prior to your new epoch&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="45px"&gt;| bin retime span=7d&lt;/TD&gt;&lt;TD width="50%" height="45px"&gt;Set bin based on new time (this gets 7 days prior going backwards)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="45px"&gt;| stats dc(_time) as days, sum(count) as count by Column, retime&lt;/TD&gt;&lt;TD width="50%" height="45px"&gt;I was interest in counts over 7 days.&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="24px"&gt;| where days = 7 | ...&lt;/TD&gt;&lt;TD width="50%" height="24px"&gt;I then only took complete weeks going forward&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Obviously the date can be recovered by subtracting from repoch again if you need it.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Aug 2020 15:14:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-modify-the-span-for-timechart-to-match-a-chart-I-m/m-p/514741#M144488</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2020-08-19T15:14:43Z</dc:date>
    </item>
  </channel>
</rss>

