<?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: Min/Max of Time Axis on Timechart Does Not Always Reflect Query Time Range in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Min-Max-of-Time-Axis-on-Timechart-Does-Not-Always-Reflect-Query/m-p/156870#M44134</link>
    <description>&lt;P&gt;The problem with "fillnull value=NULL" is that it changes my search completion time from 10 seconds to 3 minutes.&lt;BR /&gt;
Therefore that's not a good workaround.&lt;BR /&gt;
The only one that works for me is using stats before timechart.&lt;BR /&gt;
Anyway, I put in a bug report for this issue.&lt;/P&gt;</description>
    <pubDate>Tue, 20 Jan 2015 17:35:54 GMT</pubDate>
    <dc:creator>sansay</dc:creator>
    <dc:date>2015-01-20T17:35:54Z</dc:date>
    <item>
      <title>Min/Max of Time Axis on Timechart Does Not Always Reflect Query Time Range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Min-Max-of-Time-Axis-on-Timechart-Does-Not-Always-Reflect-Query/m-p/156862#M44126</link>
      <description>&lt;P&gt;If you perform a query that returns events that do not hit the left or right "edge" of your specified time range, and then timechart these events, the timechart axis starts and ends with the first and last event rather than the earliest/latest clause you specified in your query.&lt;/P&gt;

&lt;P&gt;I would expect the timechart scale to "honor" the query time range.&lt;/P&gt;

&lt;P&gt;It is an infuriating problem for those who want multiple timecharts on a dashboard as the scale on the various charts may not tally.&lt;/P&gt;

&lt;P&gt;To illustrate, here is a rather contrived example you can run yourself&lt;/P&gt;

&lt;P&gt;The below simulates a query over the last day in which all returned events fell within the middle 12h of that day - i.e. nothing during the first/last 4h&lt;/P&gt;

&lt;P&gt;index=_audit earliest=-1d latest=now&lt;BR /&gt;
| where _time&amp;lt;(now()-60*60*4) AND _time&amp;gt;(now()-60*60*20)&lt;BR /&gt;
| timechart span=5m count&lt;/P&gt;

&lt;P&gt;Notice that the timechart's x axis starts and ends with the first/last datapoint - in other words it only shows the "populated" 12h rather than the whole 24h.&lt;/P&gt;

&lt;P&gt;Now for the inelegant workaround. It appears that timechart suddenly DOES honor your timerange if you put a reporting command BEFORE the timechart, for example&lt;/P&gt;

&lt;P&gt;index=_audit earliest=-1d latest=now&lt;BR /&gt;
| where _time&amp;lt;(now()-60*60*4) AND _time&amp;gt;(now()-60*60*20)&lt;BR /&gt;
| bucket span=5m _time&lt;BR /&gt;
| stats count BY _time&lt;BR /&gt;
| timechart span=5m avg(count)&lt;/P&gt;

&lt;P&gt;I currently use this as a workaround, but it is artificial and confusing for maintainers.&lt;BR /&gt;
Anyone know of a more elegant fix?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:33:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Min-Max-of-Time-Axis-on-Timechart-Does-Not-Always-Reflect-Query/m-p/156862#M44126</guid>
      <dc:creator>puladamscom</dc:creator>
      <dc:date>2020-09-28T16:33:27Z</dc:date>
    </item>
    <item>
      <title>Re: Min/Max of Time Axis on Timechart Does Not Always Reflect Query Time Range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Min-Max-of-Time-Axis-on-Timechart-Does-Not-Always-Reflect-Query/m-p/156863#M44127</link>
      <description>&lt;P&gt;Can't seem to edit my question to get rid of a formatting gremlin. The queries should have been:&lt;/P&gt;

&lt;P&gt;index=_audit earliest=-1d latest=now&lt;BR /&gt;
| where _time&amp;lt;(now()-60 * 60 * 4) AND _time&amp;gt;(now()-60 * 60 * 20)&lt;BR /&gt;
| timechart span=5m count&lt;/P&gt;

&lt;P&gt;..... and .....&lt;/P&gt;

&lt;P&gt;index=_audit earliest=-1d latest=now&lt;BR /&gt;
| where _time&amp;lt;(now()-60 * 60 * 4) AND _time&amp;gt;(now()-60 * 60 * 20)&lt;BR /&gt;
| bucket span=5m _time&lt;BR /&gt;
| stats count BY _time&lt;BR /&gt;
| timechart span=5m avg(count)&lt;/P&gt;</description>
      <pubDate>Thu, 08 May 2014 12:14:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Min-Max-of-Time-Axis-on-Timechart-Does-Not-Always-Reflect-Query/m-p/156863#M44127</guid>
      <dc:creator>puladamscom</dc:creator>
      <dc:date>2014-05-08T12:14:08Z</dc:date>
    </item>
    <item>
      <title>Re: Min/Max of Time Axis on Timechart Does Not Always Reflect Query Time Range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Min-Max-of-Time-Axis-on-Timechart-Does-Not-Always-Reflect-Query/m-p/156864#M44128</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;
It's because of the limitation on the JS and Flashchart. Take a look at this post. If you don't put the span then timechart will smartly adjust the values.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://answers.splunk.com/answers/73745/max-data-points-that-charts-can-handle"&gt;Max Values Timechart Handles&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 08 May 2014 17:08:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Min-Max-of-Time-Axis-on-Timechart-Does-Not-Always-Reflect-Query/m-p/156864#M44128</guid>
      <dc:creator>linu1988</dc:creator>
      <dc:date>2014-05-08T17:08:30Z</dc:date>
    </item>
    <item>
      <title>Re: Min/Max of Time Axis on Timechart Does Not Always Reflect Query Time Range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Min-Max-of-Time-Axis-on-Timechart-Does-Not-Always-Reflect-Query/m-p/156865#M44129</link>
      <description>&lt;P&gt;@linu1988 I don't have an issue with the allowable number of datapoints on a chart, nor the span.&lt;BR /&gt;
If you run this query:&lt;BR /&gt;
index=* earliest=-1d latest=now | head 1 | timechart count&lt;BR /&gt;
You'll see the x axis does not cover the whole day; it just "fits" to the one datapoint returned&lt;/P&gt;</description>
      <pubDate>Thu, 08 May 2014 19:24:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Min-Max-of-Time-Axis-on-Timechart-Does-Not-Always-Reflect-Query/m-p/156865#M44129</guid>
      <dc:creator>puladamscom</dc:creator>
      <dc:date>2014-05-08T19:24:19Z</dc:date>
    </item>
    <item>
      <title>Re: Min/Max of Time Axis on Timechart Does Not Always Reflect Query Time Range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Min-Max-of-Time-Axis-on-Timechart-Does-Not-Always-Reflect-Query/m-p/156866#M44130</link>
      <description>&lt;P&gt;even if you don't use the stats and bucket it will show you the time interval you want in the timechart. If you don't mention the span it is showing one data point that you are correct.&lt;/P&gt;</description>
      <pubDate>Thu, 08 May 2014 20:05:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Min-Max-of-Time-Axis-on-Timechart-Does-Not-Always-Reflect-Query/m-p/156866#M44130</guid>
      <dc:creator>linu1988</dc:creator>
      <dc:date>2014-05-08T20:05:25Z</dc:date>
    </item>
    <item>
      <title>Re: Min/Max of Time Axis on Timechart Does Not Always Reflect Query Time Range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Min-Max-of-Time-Axis-on-Timechart-Does-Not-Always-Reflect-Query/m-p/156867#M44131</link>
      <description>&lt;P&gt;What about the fixedrange option for timechart? From the docs page (&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Timechart?r=searchtip"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Timechart?r=searchtip&lt;/A&gt;)&lt;/P&gt;

&lt;P&gt;fixedrange&lt;BR /&gt;
Syntax: fixedrange=&lt;BOOL&gt;&lt;BR /&gt;
Description: (Not valid for 4.2) Specify whether or not to enforce the earliest and latest times of the search. Setting it to false allows the timechart to constrict to just the time range with valid data. Default is True | T.&lt;/BOOL&gt;&lt;/P&gt;

&lt;P&gt;I know in the latest version of Splunk this defaults to True, but if you're not on the latest version of Splunk, then it might not be set to "true" by default. I've had similar issues, and this has fixed the issue.&lt;/P&gt;</description>
      <pubDate>Thu, 08 May 2014 20:06:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Min-Max-of-Time-Axis-on-Timechart-Does-Not-Always-Reflect-Query/m-p/156867#M44131</guid>
      <dc:creator>BenjaminWyatt</dc:creator>
      <dc:date>2014-05-08T20:06:27Z</dc:date>
    </item>
    <item>
      <title>Re: Min/Max of Time Axis on Timechart Does Not Always Reflect Query Time Range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Min-Max-of-Time-Axis-on-Timechart-Does-Not-Always-Reflect-Query/m-p/156868#M44132</link>
      <description>&lt;P&gt;I am on version 6.0.1 so pretty recent. The fixedrange=T &lt;EM&gt;promises&lt;/EM&gt; to solve my issue, but doesn't deliver&lt;BR /&gt;
To illustrate, the following query still fits the x axis to the data&lt;BR /&gt;
index=* earliest=-1d latest=now | head 1 | timechart fixedrange=T count&lt;BR /&gt;
So I guess this is a Splunk bug then&lt;/P&gt;</description>
      <pubDate>Thu, 08 May 2014 20:13:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Min-Max-of-Time-Axis-on-Timechart-Does-Not-Always-Reflect-Query/m-p/156868#M44132</guid>
      <dc:creator>puladamscom</dc:creator>
      <dc:date>2014-05-08T20:13:49Z</dc:date>
    </item>
    <item>
      <title>Re: Min/Max of Time Axis on Timechart Does Not Always Reflect Query Time Range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Min-Max-of-Time-Axis-on-Timechart-Does-Not-Always-Reflect-Query/m-p/156869#M44133</link>
      <description>&lt;P&gt;I have found a similar complaint (&lt;A href="http://answers.splunk.com/answers/96869/timechart-yesterday-forced-to-display-full-24-hours"&gt;http://answers.splunk.com/answers/96869/timechart-yesterday-forced-to-display-full-24-hours&lt;/A&gt;)&lt;BR /&gt;
This guy's workaround is a bit better than mine, which is to stick a fillnull just before the timechart.&lt;BR /&gt;
So this&lt;BR /&gt;
index=* earliest=-1d latest=now | head 1 | timechart span=1h count&lt;BR /&gt;
becomes&lt;BR /&gt;
index=* earliest=-1d latest=now | head 1 | fillnull value=NULL | timechart span=1h count&lt;/P&gt;</description>
      <pubDate>Thu, 08 May 2014 20:25:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Min-Max-of-Time-Axis-on-Timechart-Does-Not-Always-Reflect-Query/m-p/156869#M44133</guid>
      <dc:creator>puladamscom</dc:creator>
      <dc:date>2014-05-08T20:25:38Z</dc:date>
    </item>
    <item>
      <title>Re: Min/Max of Time Axis on Timechart Does Not Always Reflect Query Time Range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Min-Max-of-Time-Axis-on-Timechart-Does-Not-Always-Reflect-Query/m-p/156870#M44134</link>
      <description>&lt;P&gt;The problem with "fillnull value=NULL" is that it changes my search completion time from 10 seconds to 3 minutes.&lt;BR /&gt;
Therefore that's not a good workaround.&lt;BR /&gt;
The only one that works for me is using stats before timechart.&lt;BR /&gt;
Anyway, I put in a bug report for this issue.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jan 2015 17:35:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Min-Max-of-Time-Axis-on-Timechart-Does-Not-Always-Reflect-Query/m-p/156870#M44134</guid>
      <dc:creator>sansay</dc:creator>
      <dc:date>2015-01-20T17:35:54Z</dc:date>
    </item>
    <item>
      <title>Re: Min/Max of Time Axis on Timechart Does Not Always Reflect Query Time Range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Min-Max-of-Time-Axis-on-Timechart-Does-Not-Always-Reflect-Query/m-p/156871#M44135</link>
      <description>&lt;P&gt;Did this ever get resolved?  I had the same question here:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/108958/inconsistent-behavior-with-timechart-and-today-timeframe.html"&gt;https://answers.splunk.com/answers/108958/inconsistent-behavior-with-timechart-and-today-timeframe.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2015 15:52:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Min-Max-of-Time-Axis-on-Timechart-Does-Not-Always-Reflect-Query/m-p/156871#M44135</guid>
      <dc:creator>aferone</dc:creator>
      <dc:date>2015-10-07T15:52:21Z</dc:date>
    </item>
    <item>
      <title>Re: Min/Max of Time Axis on Timechart Does Not Always Reflect Query Time Range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Min-Max-of-Time-Axis-on-Timechart-Does-Not-Always-Reflect-Query/m-p/156872#M44136</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/7809"&gt;@aferone&lt;/a&gt; I still don't know of a proper fix, but I habitually use the following workaround.&lt;/P&gt;

&lt;P&gt;First, to recap the problem demonstrator query - it looks back over 24 hours but throws away all but the "middle" 12h of the period. The defect causes the scale bounds to "snap" to the data extents ....&lt;/P&gt;

&lt;P&gt;index=_audit earliest=-1d latest=now&lt;BR /&gt;
| where _time&amp;lt;(now()-60*60*4) AND _time&amp;gt;(now()-60*60*20)&lt;BR /&gt;
| timechart span=5m count AS tally BY host&lt;/P&gt;

&lt;P&gt;Adding the following two lines resolves that issue. You can slap these lines onto any problem query and it will do the same for you. Only thing is that you must stipulate the same span value as the first timechart, but otherwise it is totally reusable as-is...&lt;/P&gt;

&lt;P&gt;...&lt;BR /&gt;
| untable _time series value&lt;BR /&gt;
| timechart span=5m first(value) BY series&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 07:31:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Min-Max-of-Time-Axis-on-Timechart-Does-Not-Always-Reflect-Query/m-p/156872#M44136</guid>
      <dc:creator>puladamscom</dc:creator>
      <dc:date>2020-09-29T07:31:53Z</dc:date>
    </item>
  </channel>
</rss>

