<?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 can I remove the 0 values for time &amp;gt; now in a timechart that compares today to last week? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-the-0-values-for-time-gt-now-in-a-timechart/m-p/86698#M22105</link>
    <description>&lt;P&gt;tx for the feedback.  this helped too. but again it cuts off last weeks timeline at now() and mgt wants to see the full timeline of last week superimposed over today's timeline.&lt;/P&gt;</description>
    <pubDate>Thu, 11 Oct 2012 12:50:54 GMT</pubDate>
    <dc:creator>dlovett</dc:creator>
    <dc:date>2012-10-11T12:50:54Z</dc:date>
    <item>
      <title>How can I remove the 0 values for time &gt; now in a timechart that compares today to last week?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-the-0-values-for-time-gt-now-in-a-timechart/m-p/86693#M22100</link>
      <description>&lt;P&gt;I have a timechart that plots today's and last week's values using the following search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="Remedy_Tickets" Type="TKT" earliest=-0d@d latest=now | eval ReportKey="today" | append [search sourcetype="Remedy_Tickets" earliest=-7d@d latest=-6d@d | eval ReportKey="Last Week" | eval new_time=_time+(60*60*24*7)] | eval _time=if(isnotnull(new_time), new_time, _time) | timechart span=1h count by ReportKey
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The timechart superimposes the values correctly;  However, the values for today's time period &amp;gt; now() are 0 (which was 3:30pm in this example).  See table below:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;                   _time     Last Week today
1   10/10/12 12:00:00.000 AM    6       4
2   10/10/12 1:00:00.000 AM     1       1
3   10/10/12 2:00:00.000 AM     1       0
4   10/10/12 3:00:00.000 AM     1       2
5   10/10/12 4:00:00.000 AM     0       1
6   10/10/12 5:00:00.000 AM     7       4
7   10/10/12 6:00:00.000 AM     10      11
8   10/10/12 7:00:00.000 AM     52      43
9   10/10/12 8:00:00.000 AM     97      67
10  10/10/12 9:00:00.000 AM     112     86
11  10/10/12 10:00:00.000 AM    110     87
12  10/10/12 11:00:00.000 AM    126     69
13  10/10/12 12:00:00.000 PM    105     56
14  10/10/12 1:00:00.000 PM     83      57
15  10/10/12 2:00:00.000 PM     122     67
16  10/10/12 3:00:00.000 PM     73      51
17  10/10/12 4:00:00.000 PM     56      0
18  10/10/12 5:00:00.000 PM     23      0
19  10/10/12 6:00:00.000 PM     11      0
20  10/10/12 7:00:00.000 PM     2       0
21  10/10/12 8:00:00.000 PM     10      0
22  10/10/12 9:00:00.000 PM     4       0
23  10/10/12 10:00:00.000 PM    7       0
24  10/10/12 11:00:00.000 PM    5       0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I would like the line for today to end at now() just like the timechart in the Splunk Deployment Monitor Application.  Instead, my chart plots today at zero after now(). &lt;/P&gt;

&lt;P&gt;NOTE:  I would include images as a visual aid but I don't have enough karma yet &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Any help would be appreciated.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Oct 2012 20:35:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-the-0-values-for-time-gt-now-in-a-timechart/m-p/86693#M22100</guid>
      <dc:creator>dlovett</dc:creator>
      <dc:date>2012-10-10T20:35:26Z</dc:date>
    </item>
    <item>
      <title>Re: How can I remove the 0 values for time &gt; now in a timechart that compares today to last week?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-the-0-values-for-time-gt-now-in-a-timechart/m-p/86694#M22101</link>
      <description>&lt;P&gt;This query produces the same result:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=Remedy_Tickets Type=TKT earliest=-7d@d latest=-6d@d | eval marker = "Last Week" | eval _time=_time+(60*60*24*7) | append [search sourcetype=Remedy_Tickets Type=TKT earliest=-0d@d latest=now | eval marker = "Today"] | timechart fixedrange=f span=30m count by marker
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 10 Oct 2012 20:37:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-the-0-values-for-time-gt-now-in-a-timechart/m-p/86694#M22101</guid>
      <dc:creator>dlovett</dc:creator>
      <dc:date>2012-10-10T20:37:32Z</dc:date>
    </item>
    <item>
      <title>Re: How can I remove the 0 values for time &gt; now in a timechart that compares today to last week?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-the-0-values-for-time-gt-now-in-a-timechart/m-p/86695#M22102</link>
      <description>&lt;P&gt;You could do this (I just added a where command on the next-to-last line):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="Remedy_Tickets" Type="TKT" earliest=-0d@d latest=now 
| eval ReportKey="today" 
| append [search sourcetype="Remedy_Tickets" earliest=-7d@d latest=-6d@d 
       | eval ReportKey="Last Week" 
       | eval new_time=_time+(60*60*24*7)] 
| eval _time=if(isnotnull(new_time), new_time, _time) 
| where _time &amp;lt;= now()
| timechart span=1h count by ReportKey
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;CODE&gt;now()&lt;/CODE&gt; is the time that the search started. So this would keep only events that occurred before "now." &lt;/P&gt;</description>
      <pubDate>Thu, 11 Oct 2012 06:33:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-the-0-values-for-time-gt-now-in-a-timechart/m-p/86695#M22102</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2012-10-11T06:33:16Z</dc:date>
    </item>
    <item>
      <title>Re: How can I remove the 0 values for time &gt; now in a timechart that compares today to last week?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-the-0-values-for-time-gt-now-in-a-timechart/m-p/86696#M22103</link>
      <description>&lt;P&gt;One option is to snap the subsearch to the hour, rather than day:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;latest=-167h@h
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For me at least, -7d@h doesn't work, as it leaves out the last hour, that's why I specify -(6*24+23) = -167&lt;/P&gt;</description>
      <pubDate>Thu, 11 Oct 2012 08:13:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-the-0-values-for-time-gt-now-in-a-timechart/m-p/86696#M22103</guid>
      <dc:creator>echalex</dc:creator>
      <dc:date>2012-10-11T08:13:58Z</dc:date>
    </item>
    <item>
      <title>Re: How can I remove the 0 values for time &gt; now in a timechart that compares today to last week?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-the-0-values-for-time-gt-now-in-a-timechart/m-p/86697#M22104</link>
      <description>&lt;P&gt;That did help.  But that cuts off last week's timeline at now and mgt wants to see the full timeline of last week superimposed over today's timeline.  Many tx though! you've given me some ideas to experiment with &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Oct 2012 12:49:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-the-0-values-for-time-gt-now-in-a-timechart/m-p/86697#M22104</guid>
      <dc:creator>dlovett</dc:creator>
      <dc:date>2012-10-11T12:49:48Z</dc:date>
    </item>
    <item>
      <title>Re: How can I remove the 0 values for time &gt; now in a timechart that compares today to last week?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-the-0-values-for-time-gt-now-in-a-timechart/m-p/86698#M22105</link>
      <description>&lt;P&gt;tx for the feedback.  this helped too. but again it cuts off last weeks timeline at now() and mgt wants to see the full timeline of last week superimposed over today's timeline.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Oct 2012 12:50:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-the-0-values-for-time-gt-now-in-a-timechart/m-p/86698#M22105</guid>
      <dc:creator>dlovett</dc:creator>
      <dc:date>2012-10-11T12:50:54Z</dc:date>
    </item>
    <item>
      <title>Re: How can I remove the 0 values for time &gt; now in a timechart that compares today to last week?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-the-0-values-for-time-gt-now-in-a-timechart/m-p/86699#M22106</link>
      <description>&lt;P&gt;Aha, so I misinterpreted your needs, apparently?&lt;BR /&gt;
You want the full day from last week, but you don't want the zeros for today to show up, because they look bad to management and management doesn't always understand that you can't see tickets from the future?&lt;/P&gt;</description>
      <pubDate>Thu, 11 Oct 2012 12:59:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-the-0-values-for-time-gt-now-in-a-timechart/m-p/86699#M22106</guid>
      <dc:creator>echalex</dc:creator>
      <dc:date>2012-10-11T12:59:27Z</dc:date>
    </item>
    <item>
      <title>Re: How can I remove the 0 values for time &gt; now in a timechart that compares today to last week?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-the-0-values-for-time-gt-now-in-a-timechart/m-p/86700#M22107</link>
      <description>&lt;P&gt;The problem is they see what they want in other dashboards.  ie The Splunk Deployment Monitor &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;One thing I did notice is that application (Deployment Monitor) uses summary indexes.  Dunno if that makes a difference or not. But I can experiment.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Oct 2012 17:33:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-the-0-values-for-time-gt-now-in-a-timechart/m-p/86700#M22107</guid>
      <dc:creator>dlovett</dc:creator>
      <dc:date>2012-10-11T17:33:33Z</dc:date>
    </item>
    <item>
      <title>Re: How can I remove the 0 values for time &gt; now in a timechart that compares today to last week?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-the-0-values-for-time-gt-now-in-a-timechart/m-p/86701#M22108</link>
      <description>&lt;P&gt;Next attempt an at answer! Make the zeros into nulls and then use the "Missing Values: Omit" formatting option on the chart to skip them.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="Remedy_Tickets" Type="TKT" earliest=-0d@d latest=now 
| eval ReportKey="today" 
| append [search sourcetype="Remedy_Tickets" earliest=-7d@d latest=-6d@d 
       | eval ReportKey="Last Week" 
       | eval new_time=_time+(60*60*24*7)] 
| eval _time=if(isnotnull(new_time), new_time, _time) 
| timechart span=1h count by ReportKey
| eval today = if( _time &amp;lt;= now(),today,null())
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The "today" portion of the graph should end at the time that the search started.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Oct 2012 18:15:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-the-0-values-for-time-gt-now-in-a-timechart/m-p/86701#M22108</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2012-10-11T18:15:53Z</dc:date>
    </item>
    <item>
      <title>Re: How can I remove the 0 values for time &gt; now in a timechart that compares today to last week?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-the-0-values-for-time-gt-now-in-a-timechart/m-p/86702#M22109</link>
      <description>&lt;P&gt;it worked!  Many many tx!&lt;/P&gt;</description>
      <pubDate>Thu, 11 Oct 2012 19:28:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-the-0-values-for-time-gt-now-in-a-timechart/m-p/86702#M22109</guid>
      <dc:creator>dlovett</dc:creator>
      <dc:date>2012-10-11T19:28:23Z</dc:date>
    </item>
  </channel>
</rss>

