<?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 to see the top 10 categories in each span of a timechart, not for the entire duration of the chart? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-see-the-top-10-categories-in-each-span-of-a-timechart-not/m-p/114966#M30415</link>
    <description>&lt;P&gt;This is a way to do what you require - be wary - it might take EXCESSIVE amounts of time depending on your volume of information. Also - as written - this search is equivilent to "earliest=-1d@d latest=@d". &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|gentimes start=-1 end=0 increment=1h | map maxsearches=24 search="search earliest=$starttime$ latest=$endtime$ &amp;lt;your_base_search&amp;gt; | bucket _time span=1h | top useother=t limit=10 &amp;lt;some_field&amp;gt; by _time | fields - percent" | timechart limit=0 sum(count) as "WIN" by &amp;lt;some_field&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;replace &lt;CODE&gt;&amp;lt;some_field&amp;gt;&lt;/CODE&gt; with your field, and &lt;CODE&gt;&amp;lt;base_search&amp;gt;&lt;/CODE&gt; with your base search. Narrow down "base_search" as far as you can to be as specific as you can to keep this running smoothly.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Questions?&lt;/STRONG&gt; Find me on #splunk IRC on efnet.org. alacer's the name.&lt;/P&gt;</description>
    <pubDate>Mon, 08 Sep 2014 13:24:58 GMT</pubDate>
    <dc:creator>alacercogitatus</dc:creator>
    <dc:date>2014-09-08T13:24:58Z</dc:date>
    <item>
      <title>How to see the top 10 categories in each span of a timechart, not for the entire duration of the chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-see-the-top-10-categories-in-each-span-of-a-timechart-not/m-p/114962#M30411</link>
      <description>&lt;P&gt;i have stacked columns chart that covers 24h w. 1h spans&lt;BR /&gt;
i use timechart's default limit=10 and get 10 categories + OTHER.&lt;BR /&gt;
some spans in my graph are entirely made up of OTHER items.&lt;BR /&gt;
this isn't very useful.&lt;BR /&gt;
i would like to see the top 10 categories in each &lt;EM&gt;span&lt;/EM&gt; not the top 10 for the entire duration of the chart imposed on spans. &lt;BR /&gt;
is there a way to get the behaviour i'm after?&lt;/P&gt;</description>
      <pubDate>Mon, 08 Sep 2014 10:34:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-see-the-top-10-categories-in-each-span-of-a-timechart-not/m-p/114962#M30411</guid>
      <dc:creator>tomer</dc:creator>
      <dc:date>2014-09-08T10:34:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to see the top 10 categories in each span of a timechart, not for the entire duration of the chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-see-the-top-10-categories-in-each-span-of-a-timechart-not/m-p/114963#M30412</link>
      <description>&lt;P&gt;Can you please post your search. If you are trying to remove OTHER values then palce useother=f at the end of the timechart command.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Sep 2014 11:44:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-see-the-top-10-categories-in-each-span-of-a-timechart-not/m-p/114963#M30412</guid>
      <dc:creator>theouhuios</dc:creator>
      <dc:date>2014-09-08T11:44:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to see the top 10 categories in each span of a timechart, not for the entire duration of the chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-see-the-top-10-categories-in-each-span-of-a-timechart-not/m-p/114964#M30413</link>
      <description>&lt;P&gt;i'm not trying to remove OTHER.&lt;BR /&gt;
i want to keep OTHER, but i want the decision about which items are included under OTHER to be made on a per-span basis (not per chart basis).&lt;BR /&gt;
let's say host1 appears very few times in the 1st span, and many times in the 2nd span. i want it to be included under OTHER in the first span visualization, but i want to see it as its own category in the 2nd span.&lt;/P&gt;

&lt;P&gt;my search looks likes this:&lt;BR /&gt;
some_entry_type_text | timechart span=1h count by some_field&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:30:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-see-the-top-10-categories-in-each-span-of-a-timechart-not/m-p/114964#M30413</guid>
      <dc:creator>tomer</dc:creator>
      <dc:date>2020-09-28T17:30:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to see the top 10 categories in each span of a timechart, not for the entire duration of the chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-see-the-top-10-categories-in-each-span-of-a-timechart-not/m-p/114965#M30414</link>
      <description>&lt;P&gt;Hi tomer,&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;timechart&lt;/CODE&gt; will calculate the top values for the particular metric overall.&lt;BR /&gt;
If you want to show this for each hour try using something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  some_entry_type_text | bucket _time span=1h | chart count over _time by some_field
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;but still you will not get this kind of grouping for OTHER; you can use &lt;CODE&gt;limit=xx&lt;/CODE&gt; to set a limit for chart or timechart to calculate the OTHERS.&lt;/P&gt;

&lt;P&gt;Maybe this can help you to get the result you want; take this run everywhere command:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal | bucket _time span=1h | stats count by series, _time | chart limit=10 count over _time by series
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;this will &lt;CODE&gt;stats&lt;/CODE&gt; the hourly buckets frist and use them in a chart, adopt it to your needs and see if it helps.&lt;/P&gt;

&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;some_entry_type_text | bucket _time span=1h | stats count by some_field, _time | chart limit=20 count over _time by some_field
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;cheers, Mus&lt;/P&gt;</description>
      <pubDate>Mon, 08 Sep 2014 12:30:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-see-the-top-10-categories-in-each-span-of-a-timechart-not/m-p/114965#M30414</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-09-08T12:30:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to see the top 10 categories in each span of a timechart, not for the entire duration of the chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-see-the-top-10-categories-in-each-span-of-a-timechart-not/m-p/114966#M30415</link>
      <description>&lt;P&gt;This is a way to do what you require - be wary - it might take EXCESSIVE amounts of time depending on your volume of information. Also - as written - this search is equivilent to "earliest=-1d@d latest=@d". &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|gentimes start=-1 end=0 increment=1h | map maxsearches=24 search="search earliest=$starttime$ latest=$endtime$ &amp;lt;your_base_search&amp;gt; | bucket _time span=1h | top useother=t limit=10 &amp;lt;some_field&amp;gt; by _time | fields - percent" | timechart limit=0 sum(count) as "WIN" by &amp;lt;some_field&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;replace &lt;CODE&gt;&amp;lt;some_field&amp;gt;&lt;/CODE&gt; with your field, and &lt;CODE&gt;&amp;lt;base_search&amp;gt;&lt;/CODE&gt; with your base search. Narrow down "base_search" as far as you can to be as specific as you can to keep this running smoothly.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Questions?&lt;/STRONG&gt; Find me on #splunk IRC on efnet.org. alacer's the name.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Sep 2014 13:24:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-see-the-top-10-categories-in-each-span-of-a-timechart-not/m-p/114966#M30415</guid>
      <dc:creator>alacercogitatus</dc:creator>
      <dc:date>2014-09-08T13:24:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to see the top 10 categories in each span of a timechart, not for the entire duration of the chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-see-the-top-10-categories-in-each-span-of-a-timechart-not/m-p/114967#M30416</link>
      <description>&lt;P&gt;Shouldn't there be a limit=0 in the &lt;CODE&gt;timechart&lt;/CODE&gt; at the end?&lt;/P&gt;

&lt;P&gt;Also, be wary of huge numbers of hard-to-distinguish colours being used, up to 241 in fact.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Sep 2014 13:51:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-see-the-top-10-categories-in-each-span-of-a-timechart-not/m-p/114967#M30416</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-09-08T13:51:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to see the top 10 categories in each span of a timechart, not for the entire duration of the chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-see-the-top-10-categories-in-each-span-of-a-timechart-not/m-p/114968#M30417</link>
      <description>&lt;P&gt;You can set limit=0, sure. Then you won't be limiting the limits.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Sep 2014 13:56:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-see-the-top-10-categories-in-each-span-of-a-timechart-not/m-p/114968#M30417</guid>
      <dc:creator>alacercogitatus</dc:creator>
      <dc:date>2014-09-08T13:56:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to see the top 10 categories in each span of a timechart, not for the entire duration of the chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-see-the-top-10-categories-in-each-span-of-a-timechart-not/m-p/114969#M30418</link>
      <description>&lt;P&gt;alacercogitatus, &lt;BR /&gt;
i started working off of what MuS suggested and came up with something almost identical to your suggestion except without gentime/map - &lt;BR /&gt;
&lt;BASE_SERACH&gt; | bucket _time span=1h | top limit=10 useother=t &lt;SOME_FIELD&gt; by _time | timechart span=1h limit=0 sum(count) by &lt;SOME_FIELD&gt;&lt;/SOME_FIELD&gt;&lt;/SOME_FIELD&gt;&lt;/BASE_SERACH&gt;&lt;/P&gt;

&lt;P&gt;i think gentimes/map are redundant here - do you agree? do you have a scenario in mind where they would produce different results?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:30:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-see-the-top-10-categories-in-each-span-of-a-timechart-not/m-p/114969#M30418</guid>
      <dc:creator>tomer</dc:creator>
      <dc:date>2020-09-28T17:30:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to see the top 10 categories in each span of a timechart, not for the entire duration of the chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-see-the-top-10-categories-in-each-span-of-a-timechart-not/m-p/114970#M30419</link>
      <description>&lt;P&gt;I don't have any in mind just this moment. There might be one. Yours is pretty slick, good job!&lt;/P&gt;</description>
      <pubDate>Mon, 08 Sep 2014 14:25:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-see-the-top-10-categories-in-each-span-of-a-timechart-not/m-p/114970#M30419</guid>
      <dc:creator>alacercogitatus</dc:creator>
      <dc:date>2014-09-08T14:25:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to see the top 10 categories in each span of a timechart, not for the entire duration of the chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-see-the-top-10-categories-in-each-span-of-a-timechart-not/m-p/114971#M30420</link>
      <description>&lt;P&gt;using &lt;CODE&gt;top&lt;/CODE&gt; instead of &lt;CODE&gt;stats&lt;/CODE&gt; - nice &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Sep 2014 14:40:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-see-the-top-10-categories-in-each-span-of-a-timechart-not/m-p/114971#M30420</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-09-08T14:40:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to see the top 10 categories in each span of a timechart, not for the entire duration of the chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-see-the-top-10-categories-in-each-span-of-a-timechart-not/m-p/114972#M30421</link>
      <description>&lt;P&gt;Another way is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;your_base_search&amp;gt; | bucket _time span=1h | top 10 categories by _time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 16 Nov 2016 13:19:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-see-the-top-10-categories-in-each-span-of-a-timechart-not/m-p/114972#M30421</guid>
      <dc:creator>moisesroth</dc:creator>
      <dc:date>2016-11-16T13:19:25Z</dc:date>
    </item>
  </channel>
</rss>

