<?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: piping events from a custom generating command into timechart results in irregular buckets when not using all-time in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/piping-events-from-a-custom-generating-command-into-timechart/m-p/160019#M45199</link>
    <description>&lt;P&gt;I assumed your search was all-time.  Is it?  &lt;/P&gt;</description>
    <pubDate>Sat, 11 Oct 2014 22:09:13 GMT</pubDate>
    <dc:creator>jrodman</dc:creator>
    <dc:date>2014-10-11T22:09:13Z</dc:date>
    <item>
      <title>piping events from a custom generating command into timechart results in irregular buckets when not using all-time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/piping-events-from-a-custom-generating-command-into-timechart/m-p/160011#M45191</link>
      <description>&lt;P&gt;I have 26 days of events (Monday 9/15 through Friday 10/10) piped to a timechart span=7d.&lt;/P&gt;

&lt;P&gt;I'd like to have 3 buckets of 7 days each, and one bucket with the 5 remainder days. It doesn't matter to me if the remainder bucket is at the beginning or end but it would be nice if Splunk was consistent about it.&lt;/P&gt;

&lt;P&gt;Instead, my buckets begin at 9/15, 9/22, 9/29 (Mondays), 10/3, 10/10 (Fridays) which means I have 5 buckets, instead of 4, &lt;BR /&gt;
with 7, 7, 4, 7, and 1 day in them.&lt;/P&gt;

&lt;P&gt;How can I make timechart behave reasonably?&lt;/P&gt;

&lt;P&gt;I'm running Splunk 6.1.2&lt;/P&gt;</description>
      <pubDate>Sat, 11 Oct 2014 06:31:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/piping-events-from-a-custom-generating-command-into-timechart/m-p/160011#M45191</guid>
      <dc:creator>ruman</dc:creator>
      <dc:date>2014-10-11T06:31:57Z</dc:date>
    </item>
    <item>
      <title>Re: piping events from a custom generating command into timechart results in irregular buckets when not using all-time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/piping-events-from-a-custom-generating-command-into-timechart/m-p/160012#M45192</link>
      <description>&lt;P&gt;I'd suggest editing this to describe your specific goal.  Documenting the fail seems more like a thing for jira.&lt;/P&gt;</description>
      <pubDate>Sat, 11 Oct 2014 06:35:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/piping-events-from-a-custom-generating-command-into-timechart/m-p/160012#M45192</guid>
      <dc:creator>jrodman</dc:creator>
      <dc:date>2014-10-11T06:35:24Z</dc:date>
    </item>
    <item>
      <title>Re: piping events from a custom generating command into timechart results in irregular buckets when not using all-time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/piping-events-from-a-custom-generating-command-into-timechart/m-p/160013#M45193</link>
      <description>&lt;P&gt;okay, i tried!&lt;/P&gt;</description>
      <pubDate>Sat, 11 Oct 2014 16:00:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/piping-events-from-a-custom-generating-command-into-timechart/m-p/160013#M45193</guid>
      <dc:creator>ruman</dc:creator>
      <dc:date>2014-10-11T16:00:57Z</dc:date>
    </item>
    <item>
      <title>Re: piping events from a custom generating command into timechart results in irregular buckets when not using all-time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/piping-events-from-a-custom-generating-command-into-timechart/m-p/160014#M45194</link>
      <description>&lt;P&gt;Next year at conf, I need to not give away so much karma that I can no longer comment. But what are you using for your earliest search time? I've noticed that timechart and bucket/bin use this for the base of the buckets: &lt;A href="https://gist.github.com/acharlieh/777d6767378e82427d00"&gt;https://gist.github.com/acharlieh/777d6767378e82427d00&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 11 Oct 2014 18:05:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/piping-events-from-a-custom-generating-command-into-timechart/m-p/160014#M45194</guid>
      <dc:creator>acharlieh</dc:creator>
      <dc:date>2014-10-11T18:05:16Z</dc:date>
    </item>
    <item>
      <title>Re: piping events from a custom generating command into timechart results in irregular buckets when not using all-time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/piping-events-from-a-custom-generating-command-into-timechart/m-p/160015#M45195</link>
      <description>&lt;P&gt;in this case the events are coming from an external command, then i'm removing older events with a where clause. i don't know what that means "earliest" is. And I don't quite get what's going on with your gist, but I'll experiment with it and write back...if span=w, then why does earliest need be -40d or earlier?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| foo bar bas
| eval earliest_ts=relative_time(now(), "-3w@w0")
| where _time &amp;gt; earliest_ts
| timechart span=1w count by bat
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 11 Oct 2014 18:59:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/piping-events-from-a-custom-generating-command-into-timechart/m-p/160015#M45195</guid>
      <dc:creator>ruman</dc:creator>
      <dc:date>2014-10-11T18:59:42Z</dc:date>
    </item>
    <item>
      <title>Re: piping events from a custom generating command into timechart results in irregular buckets when not using all-time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/piping-events-from-a-custom-generating-command-into-timechart/m-p/160016#M45196</link>
      <description>&lt;P&gt;So the crux of this issue here is that every search in Splunk has a timerange with it. Also &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Timechart"&gt;timechart&lt;/A&gt; uses the earliest time of the search to figure out what times fit into what bucket. When you generate results (with an external command or creative uses of other commands) that have results with _time fields outside of the range of the search, oddity occurs. As jrodman says in the comments below, often times you should set the search timeframe to all time, or at least manipulate earliest.&lt;/P&gt;

&lt;P&gt;Alternatively you can use &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Eval"&gt;eval&lt;/A&gt; with the &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/CommonEvalFunctions"&gt;relative_time&lt;/A&gt; function to manipulate _time into desired buckets, and then use &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/chart"&gt;chart&lt;/A&gt;.&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;Original Comment: &lt;/P&gt;

&lt;P&gt;Ah! So the issue there is that every search in Splunk has an earliest and latest time. When you generate events from an external command that fall outside the time range of your search, it throws off the bucketing done by the bin / timechart command. My &lt;A href="https://gist.github.com/acharlieh/777d6767378e82427d00"&gt;gist&lt;/A&gt; is generating 40 days of events so I needed to make sure my search window was 40 days otherwise you wind up with funniness at the search boundary. But the second form using eval and relative_time should work better&lt;/P&gt;</description>
      <pubDate>Sat, 11 Oct 2014 19:06:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/piping-events-from-a-custom-generating-command-into-timechart/m-p/160016#M45196</guid>
      <dc:creator>acharlieh</dc:creator>
      <dc:date>2014-10-11T19:06:33Z</dc:date>
    </item>
    <item>
      <title>Re: piping events from a custom generating command into timechart results in irregular buckets when not using all-time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/piping-events-from-a-custom-generating-command-into-timechart/m-p/160017#M45197</link>
      <description>&lt;P&gt;oh, that's really interesting. so maybe i need to match the time picker to range of the events that hit timechart in order to make the buckets happy? i've got lots to experiment with now, thank you!&lt;/P&gt;</description>
      <pubDate>Sat, 11 Oct 2014 19:14:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/piping-events-from-a-custom-generating-command-into-timechart/m-p/160017#M45197</guid>
      <dc:creator>ruman</dc:creator>
      <dc:date>2014-10-11T19:14:36Z</dc:date>
    </item>
    <item>
      <title>Re: piping events from a custom generating command into timechart results in irregular buckets when not using all-time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/piping-events-from-a-custom-generating-command-into-timechart/m-p/160018#M45198</link>
      <description>&lt;P&gt;Indeed! Or instead of manipulating the search range, use eval to manipulate the _time field into the correct buckets and then chart (instead of timechart) &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; have fun!&lt;/P&gt;</description>
      <pubDate>Sat, 11 Oct 2014 19:25:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/piping-events-from-a-custom-generating-command-into-timechart/m-p/160018#M45198</guid>
      <dc:creator>acharlieh</dc:creator>
      <dc:date>2014-10-11T19:25:41Z</dc:date>
    </item>
    <item>
      <title>Re: piping events from a custom generating command into timechart results in irregular buckets when not using all-time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/piping-events-from-a-custom-generating-command-into-timechart/m-p/160019#M45199</link>
      <description>&lt;P&gt;I assumed your search was all-time.  Is it?  &lt;/P&gt;</description>
      <pubDate>Sat, 11 Oct 2014 22:09:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/piping-events-from-a-custom-generating-command-into-timechart/m-p/160019#M45199</guid>
      <dc:creator>jrodman</dc:creator>
      <dc:date>2014-10-11T22:09:13Z</dc:date>
    </item>
    <item>
      <title>Re: piping events from a custom generating command into timechart results in irregular buckets when not using all-time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/piping-events-from-a-custom-generating-command-into-timechart/m-p/160020#M45200</link>
      <description>&lt;P&gt;no, the time picker was definitely not set to 'all time', and the external command i'm running completely ignores the time picke.r&lt;/P&gt;</description>
      <pubDate>Sun, 12 Oct 2014 02:16:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/piping-events-from-a-custom-generating-command-into-timechart/m-p/160020#M45200</guid>
      <dc:creator>ruman</dc:creator>
      <dc:date>2014-10-12T02:16:21Z</dc:date>
    </item>
    <item>
      <title>Re: piping events from a custom generating command into timechart results in irregular buckets when not using all-time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/piping-events-from-a-custom-generating-command-into-timechart/m-p/160021#M45201</link>
      <description>&lt;P&gt;It should probably be set to all time if the input is going to ignore it.&lt;/P&gt;</description>
      <pubDate>Sun, 12 Oct 2014 03:10:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/piping-events-from-a-custom-generating-command-into-timechart/m-p/160021#M45201</guid>
      <dc:creator>jrodman</dc:creator>
      <dc:date>2014-10-12T03:10:04Z</dc:date>
    </item>
    <item>
      <title>Re: piping events from a custom generating command into timechart results in irregular buckets when not using all-time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/piping-events-from-a-custom-generating-command-into-timechart/m-p/160022#M45202</link>
      <description>&lt;P&gt;yup, ding. setting the time picker to all time makes very normal buckets. thanks everyone.&lt;/P&gt;</description>
      <pubDate>Sun, 12 Oct 2014 04:48:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/piping-events-from-a-custom-generating-command-into-timechart/m-p/160022#M45202</guid>
      <dc:creator>ruman</dc:creator>
      <dc:date>2014-10-12T04:48:25Z</dc:date>
    </item>
    <item>
      <title>Re: piping events from a custom generating command into timechart results in irregular buckets when not using all-time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/piping-events-from-a-custom-generating-command-into-timechart/m-p/160023#M45203</link>
      <description>&lt;P&gt;I moved this to an answer because it was the crucial insight.  If you're willing to edit it a bit to be clearer for future readers feel free, or I'm happy to do so.&lt;/P&gt;</description>
      <pubDate>Sun, 12 Oct 2014 05:16:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/piping-events-from-a-custom-generating-command-into-timechart/m-p/160023#M45203</guid>
      <dc:creator>jrodman</dc:creator>
      <dc:date>2014-10-12T05:16:27Z</dc:date>
    </item>
    <item>
      <title>Re: piping events from a custom generating command into timechart results in irregular buckets when not using all-time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/piping-events-from-a-custom-generating-command-into-timechart/m-p/160024#M45204</link>
      <description>&lt;P&gt;and even better, setting the time picker to the exact day the events start, makes the buckets start on that day, e.g. i can make sure the buckets start on mondays by having the timepicker set earliest to -3w@w1.&lt;/P&gt;</description>
      <pubDate>Sun, 12 Oct 2014 05:25:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/piping-events-from-a-custom-generating-command-into-timechart/m-p/160024#M45204</guid>
      <dc:creator>ruman</dc:creator>
      <dc:date>2014-10-12T05:25:10Z</dc:date>
    </item>
  </channel>
</rss>

