<?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: Removing empty bins in timechart in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Removing-empty-bins-in-timechart/m-p/447835#M126928</link>
    <description>&lt;P&gt;Thanks for the answer, unfortunately I still see the day that I want to remove when I use this. No values show for the day, but the day is still present in the chart.&lt;/P&gt;</description>
    <pubDate>Fri, 27 Jul 2018 15:27:18 GMT</pubDate>
    <dc:creator>dtow1</dc:creator>
    <dc:date>2018-07-27T15:27:18Z</dc:date>
    <item>
      <title>Removing empty bins in timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Removing-empty-bins-in-timechart/m-p/447828#M126921</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I am unable to eliminate empty buckets using the timechart command since moving to Splunk 7.0.  For example in the below query I will see a gap for Tuesday and a continuous line from the Monday value to the Wednesday value. I'd like the chart (in this example) to not show Tuesday at all, just go from Monday to Wednesday. This used to work in older versions, so is there a modification needed to get this to work in Splunk 7.0+.&lt;/P&gt;

&lt;P&gt;Thanks for any assistance.&lt;/P&gt;

&lt;P&gt;index="_audit" |  timechart cont=false count(date_wday) by date_wday | eval date_wday=lower(strftime(_time,"%A")) | where (date_wday!="tuesday") | fields - date_wday&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 20:30:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Removing-empty-bins-in-timechart/m-p/447828#M126921</guid>
      <dc:creator>dtow1</dc:creator>
      <dc:date>2020-09-29T20:30:56Z</dc:date>
    </item>
    <item>
      <title>Re: Removing empty bins in timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Removing-empty-bins-in-timechart/m-p/447829#M126922</link>
      <description>&lt;P&gt;If you use &lt;CODE&gt;stats&lt;/CODE&gt; this will give you what you're looking for &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="_audit" 
| stats count(date_wday) by date_wday 
| eval date_wday=lower(strftime(_time,"%A")) 
| where (date_wday!="tuesday") 
| fields - date_wday
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Jul 2018 18:47:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Removing-empty-bins-in-timechart/m-p/447829#M126922</guid>
      <dc:creator>skoelpin</dc:creator>
      <dc:date>2018-07-18T18:47:56Z</dc:date>
    </item>
    <item>
      <title>Re: Removing empty bins in timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Removing-empty-bins-in-timechart/m-p/447830#M126923</link>
      <description>&lt;P&gt;@dtow1 did this help you?&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jul 2018 16:14:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Removing-empty-bins-in-timechart/m-p/447830#M126923</guid>
      <dc:creator>skoelpin</dc:creator>
      <dc:date>2018-07-24T16:14:56Z</dc:date>
    </item>
    <item>
      <title>Re: Removing empty bins in timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Removing-empty-bins-in-timechart/m-p/447831#M126924</link>
      <description>&lt;P&gt;Hi skoelpin,&lt;/P&gt;

&lt;P&gt;Unfortunately it did not. I'm still playing around with it though and if the solution comes out of a modification of what you posted I will accept it as the answer and update it with whatever the total solution is.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jul 2018 16:31:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Removing-empty-bins-in-timechart/m-p/447831#M126924</guid>
      <dc:creator>dtow1</dc:creator>
      <dc:date>2018-07-24T16:31:59Z</dc:date>
    </item>
    <item>
      <title>Re: Removing empty bins in timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Removing-empty-bins-in-timechart/m-p/447832#M126925</link>
      <description>&lt;P&gt;Thank you for answering though and giving me other avenues to try.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jul 2018 16:32:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Removing-empty-bins-in-timechart/m-p/447832#M126925</guid>
      <dc:creator>dtow1</dc:creator>
      <dc:date>2018-07-24T16:32:29Z</dc:date>
    </item>
    <item>
      <title>Re: Removing empty bins in timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Removing-empty-bins-in-timechart/m-p/447833#M126926</link>
      <description>&lt;P&gt;You are working too hard.  &lt;CODE&gt;timechart&lt;/CODE&gt; will already &lt;CODE&gt;bin&lt;/CODE&gt; the days for you automatically, so it doesn't make sense for you to be binning the count up by &lt;CODE&gt;date_wday&lt;/CODE&gt;. &lt;/P&gt;

&lt;P&gt;Use this if you are only doing your count by day:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="_audit" 
| timechart span=d count 
| where count&amp;gt;0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;On the other hand, if you are doing your count by hour, and also want to eliminate days where there were no count at all, then you need something slightly more complex.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="_audit" 
| timechart span=h count as mycount 
| bin _time span=1d as Day 
| eventstats sum(mycount) as Daycount by Day 
| where Daycount &amp;gt; 0 
| fields - Day Daycount
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And if you just want to kill Tuesday July 17, 2018 , for no particular reason, then you could do this...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="_audit" 
| timechart span=h count as mycount 
| where strftime(_time,"%Y-%m-%d") != "2018-07-24" 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Jul 2018 16:47:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Removing-empty-bins-in-timechart/m-p/447833#M126926</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2018-07-24T16:47:12Z</dc:date>
    </item>
    <item>
      <title>Re: Removing empty bins in timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Removing-empty-bins-in-timechart/m-p/447834#M126927</link>
      <description>&lt;P&gt;You are looking at it the wrong way.  Run for &lt;CODE&gt;Last 7 days&lt;/CODE&gt; and check out the difference (note &lt;CODE&gt;cont=&lt;/CODE&gt;) in the number of ROWS between this search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="_audit" 
| eval date_wday=lower(strftime(_time,"%A")) 
| where (date_wday!="tuesday") 
| timechart span=1d cont=false count(date_wday) by date_wday
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And this search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="_audit" 
| eval date_wday=lower(strftime(_time,"%A")) 
| where (date_wday!="tuesday") 
| timechart span=1d cont=true count(date_wday) by date_wday
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Jul 2018 18:42:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Removing-empty-bins-in-timechart/m-p/447834#M126927</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2018-07-24T18:42:03Z</dc:date>
    </item>
    <item>
      <title>Re: Removing empty bins in timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Removing-empty-bins-in-timechart/m-p/447835#M126928</link>
      <description>&lt;P&gt;Thanks for the answer, unfortunately I still see the day that I want to remove when I use this. No values show for the day, but the day is still present in the chart.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jul 2018 15:27:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Removing-empty-bins-in-timechart/m-p/447835#M126928</guid>
      <dc:creator>dtow1</dc:creator>
      <dc:date>2018-07-27T15:27:18Z</dc:date>
    </item>
    <item>
      <title>Re: Removing empty bins in timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Removing-empty-bins-in-timechart/m-p/447836#M126929</link>
      <description>&lt;P&gt;Thanks for answering, this still has the same issue that for me though.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jul 2018 15:27:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Removing-empty-bins-in-timechart/m-p/447836#M126929</guid>
      <dc:creator>dtow1</dc:creator>
      <dc:date>2018-07-27T15:27:40Z</dc:date>
    </item>
    <item>
      <title>Re: Removing empty bins in timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Removing-empty-bins-in-timechart/m-p/447837#M126930</link>
      <description>&lt;P&gt;Working with Splunk support, it appears that it is a bug. Thank you very much for taking the time to answer.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Aug 2018 22:45:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Removing-empty-bins-in-timechart/m-p/447837#M126930</guid>
      <dc:creator>dtow1</dc:creator>
      <dc:date>2018-08-07T22:45:25Z</dc:date>
    </item>
    <item>
      <title>Re: Removing empty bins in timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Removing-empty-bins-in-timechart/m-p/447838#M126931</link>
      <description>&lt;P&gt;Thank you for answering. It turns out that it is a bug.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Aug 2018 22:46:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Removing-empty-bins-in-timechart/m-p/447838#M126931</guid>
      <dc:creator>dtow1</dc:creator>
      <dc:date>2018-08-07T22:46:00Z</dc:date>
    </item>
    <item>
      <title>Re: Removing empty bins in timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Removing-empty-bins-in-timechart/m-p/447839#M126932</link>
      <description>&lt;P&gt;Thank you for answering. It turns out that the issue is a bug in our environment. &lt;/P&gt;</description>
      <pubDate>Tue, 07 Aug 2018 22:46:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Removing-empty-bins-in-timechart/m-p/447839#M126932</guid>
      <dc:creator>dtow1</dc:creator>
      <dc:date>2018-08-07T22:46:45Z</dc:date>
    </item>
  </channel>
</rss>

