<?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: Timechart limit order in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Timechart-limit-order/m-p/122305#M32905</link>
    <description>&lt;P&gt;I may have overlooked some conditions. Could you try the updated answer?&lt;/P&gt;</description>
    <pubDate>Mon, 30 Jun 2014 13:38:17 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2014-06-30T13:38:17Z</dc:date>
    <item>
      <title>Timechart limit order</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-limit-order/m-p/122302#M32902</link>
      <description>&lt;P&gt;My goal is to create a stacked area timechart that has the number of unique "users" on y-axis split by "user age", where "user age" is bucketed into 1 day spans and the first 5 buckets from 0 upward are included in the plot (with rest of the buckets in OTHER). The search&lt;/P&gt;

&lt;P&gt;timechart dc(user) span=1d by limit=5 user_age span=1d&lt;/P&gt;

&lt;P&gt;does almost what I want, except it includs the 5 largest buckets, not first 5 consecutive buckets as I would want. &lt;EM&gt;Top N values based on the sum of each series&lt;/EM&gt; is the default documented behavior of &lt;LIMIT&gt;, but is there a way to specify first five (in order) instead?&lt;/LIMIT&gt;&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jun 2014 12:54:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-limit-order/m-p/122302#M32902</guid>
      <dc:creator>asetyyli</dc:creator>
      <dc:date>2014-06-27T12:54:28Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart limit order</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-limit-order/m-p/122303#M32903</link>
      <description>&lt;P&gt;Give this workaround a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Your base search with fields user, _time, user_age | bucket span=1d _time | stats dc(user) as UserCount by _time user_age | sort user_age | streamstats count as sno by user_age | eval sno=if(sno&amp;gt;1,0,sno) | accum sno | eval user_age=if(sno&amp;gt;5,"OTHER",user_age) | timechart span=1d sum(UserCount) by user_age
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 27 Jun 2014 14:51:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-limit-order/m-p/122303#M32903</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-06-27T14:51:50Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart limit order</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-limit-order/m-p/122304#M32904</link>
      <description>&lt;P&gt;Thanks for the reply. I changed the span to 1d in both places in your example, because I'm intersted in day sized buckets both with _time &amp;amp; user_age. Unfortunately I'm not getting the same total distinct user count as with plain "timechart dc(user) span=1d".&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:57:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-limit-order/m-p/122304#M32904</guid>
      <dc:creator>asetyyli</dc:creator>
      <dc:date>2020-09-28T16:57:40Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart limit order</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-limit-order/m-p/122305#M32905</link>
      <description>&lt;P&gt;I may have overlooked some conditions. Could you try the updated answer?&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jun 2014 13:38:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-limit-order/m-p/122305#M32905</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-06-30T13:38:17Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart limit order</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-limit-order/m-p/122306#M32906</link>
      <description>&lt;P&gt;Thanks for the revised answer. It seems I need to bucket the user_age at the beginning to make your method work (bucket span=1d user_age). The resulting counts are inflated slightly compared with a search without splitting by user_age, though. When we are doing "stats dc(user) as UserCount by _time user_age" users that have a transition in user_age within a _time bucket are counted twice, right?&lt;/P&gt;

&lt;P&gt;Some background: user_age is a field containing the time in seconds elapsed after the creation of a specific user at the time of the recorded event. Basically user_age = (_time - user_created_ts).&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:02:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-limit-order/m-p/122306#M32906</guid>
      <dc:creator>asetyyli</dc:creator>
      <dc:date>2020-09-28T17:02:25Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart limit order</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-limit-order/m-p/122307#M32907</link>
      <description>&lt;P&gt;Its tough to say without looking at the logs. Would you mind providing some and also sample output based on that data?&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jul 2014 14:59:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-limit-order/m-p/122307#M32907</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-07-11T14:59:31Z</dc:date>
    </item>
  </channel>
</rss>

