<?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 get the top 10 values using timechart? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-top-10-values-using-timechart/m-p/321452#M96028</link>
    <description>&lt;P&gt;It is exactly as @madrum mentioned. For me too, value for "NULL" and "OTHER" always overshadows the data. This is surprising because these two categories never overshadow the values when executed as a stats (instead of a timechart) command.&lt;/P&gt;

&lt;P&gt;Additionally, '..max in topN' did NOT restrict my timechart unique values to N. It didn't seem to have any effect on teh command AT ALL. Not sure why. &lt;/P&gt;</description>
    <pubDate>Wed, 29 Apr 2020 18:30:32 GMT</pubDate>
    <dc:creator>rey123</dc:creator>
    <dc:date>2020-04-29T18:30:32Z</dc:date>
    <item>
      <title>How to get the top 10 values using timechart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-top-10-values-using-timechart/m-p/321445#M96021</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have this query and it works just fine&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=blah1 OR index=blah2 OR index=blah3 host=*media* "/fileUpload/image" |rex "(?&amp;lt;ip&amp;gt;(?:[0-9]{1,3}\.){3}[0-9]{1,3})[\s,]"|eval index=if(index="blah3","beta",index)|eval ii=index+" - "+ip|timechart  usenull=f count by ii |sort -count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What I'd like to have the time chart do is capture the top 10 ii values from the eval command.&lt;/P&gt;

&lt;P&gt;Any thoughts?&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jan 2018 20:04:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-top-10-values-using-timechart/m-p/321445#M96021</guid>
      <dc:creator>dbcase</dc:creator>
      <dc:date>2018-01-19T20:04:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the top 10 values using timechart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-top-10-values-using-timechart/m-p/321446#M96022</link>
      <description>&lt;P&gt;hey you can try something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=blah1 OR index=blah2 OR index=blah3 host=*media* "/fileUpload/image" |rex "(?&amp;lt;ip&amp;gt;(?:[0-9]{1,3}\.){3}[0-9]{1,3})[\s,]"|eval index=if(index="blah3","beta",index)|eval ii=index+" - "+ip|timechart  usenull=f count by ii where max in top10 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;CODE&gt;max in top10&lt;/CODE&gt; means &lt;CODE&gt;top 10 ii values&lt;/CODE&gt;&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Timechart#Where_clause_Examples"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Timechart#Where_clause_Examples&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;let me know if this helps!&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jan 2018 20:21:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-top-10-values-using-timechart/m-p/321446#M96022</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2018-01-19T20:21:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the top 10 values using timechart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-top-10-values-using-timechart/m-p/321447#M96023</link>
      <description>&lt;P&gt;Nice! I was unaware of the &lt;CODE&gt;where in&lt;/CODE&gt; functionality in timechart.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jan 2018 20:31:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-top-10-values-using-timechart/m-p/321447#M96023</guid>
      <dc:creator>micahkemp</dc:creator>
      <dc:date>2018-01-19T20:31:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the top 10 values using timechart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-top-10-values-using-timechart/m-p/321448#M96024</link>
      <description>&lt;P&gt;ooooohhhh now that is really slick!  Thank you mayurr98!&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jan 2018 20:45:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-top-10-values-using-timechart/m-p/321448#M96024</guid>
      <dc:creator>dbcase</dc:creator>
      <dc:date>2018-01-19T20:45:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the top 10 values using timechart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-top-10-values-using-timechart/m-p/321449#M96025</link>
      <description>&lt;P&gt;Ditto what @micahkemp said. Neat trick.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jan 2018 21:00:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-top-10-values-using-timechart/m-p/321449#M96025</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2018-01-19T21:00:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the top 10 values using timechart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-top-10-values-using-timechart/m-p/321450#M96026</link>
      <description>&lt;P&gt;Just to add to this, here's the link to the specific portion in the documentation that covers the &lt;CODE&gt;where in&lt;/CODE&gt; examples which is much higher up on that page: &lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/7.0.3/SearchReference/Timechart#where_clause"&gt;http://docs.splunk.com/Documentation/Splunk/7.0.3/SearchReference/Timechart#where_clause&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Apr 2018 23:05:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-top-10-values-using-timechart/m-p/321450#M96026</guid>
      <dc:creator>ppablo</dc:creator>
      <dc:date>2018-04-04T23:05:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the top 10 values using timechart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-top-10-values-using-timechart/m-p/321451#M96027</link>
      <description>&lt;P&gt;I have over 100 values and the value for the "OTHER" data point was overshadowing the data I wanted to see. I was able to hide the data with a hack that set the value for OTHER to 0 and hide "OTHER" from the legend by renaming it to underscore which will not be displayed.&lt;/P&gt;

&lt;P&gt;I copied the answer by mayurr98 and added the hack to the end.&lt;/P&gt;

&lt;P&gt;index=blah1 OR index=blah2 OR index=blah3 host=&lt;EM&gt;media&lt;/EM&gt; "/fileUpload/image" |rex "(?(?:[0-9]{1,3}.){3}[0-9]{1,3})[\s,]"|eval index=if(index="blah3","beta",index)|eval ii=index+" - "+ip|timechart  usenull=f count by ii where max in top10 &lt;BR /&gt;
|eval OTHER = 0&lt;BR /&gt;
|rename OTHER = "_"&lt;/P&gt;</description>
      <pubDate>Fri, 20 Sep 2019 19:12:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-top-10-values-using-timechart/m-p/321451#M96027</guid>
      <dc:creator>madrum</dc:creator>
      <dc:date>2019-09-20T19:12:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the top 10 values using timechart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-top-10-values-using-timechart/m-p/321452#M96028</link>
      <description>&lt;P&gt;It is exactly as @madrum mentioned. For me too, value for "NULL" and "OTHER" always overshadows the data. This is surprising because these two categories never overshadow the values when executed as a stats (instead of a timechart) command.&lt;/P&gt;

&lt;P&gt;Additionally, '..max in topN' did NOT restrict my timechart unique values to N. It didn't seem to have any effect on teh command AT ALL. Not sure why. &lt;/P&gt;</description>
      <pubDate>Wed, 29 Apr 2020 18:30:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-top-10-values-using-timechart/m-p/321452#M96028</guid>
      <dc:creator>rey123</dc:creator>
      <dc:date>2020-04-29T18:30:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the top 10 values using timechart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-top-10-values-using-timechart/m-p/321453#M96029</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| makeresults count=2
| streamstats count
| eval _time=relative_time(_time,(-1*count)."d@d") 
| makecontinuous _time span=1min
| eval counts=random() % 100, host=mvindex(split("ABCDEFGHIJKLMNOPQRSTUVWXYZ",""),random() % 26)
| timechart cont=f max(counts) by host where max in top26
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;in default, &lt;CODE&gt;timechart&lt;/CODE&gt; displays 5 fields and &lt;EM&gt;OTHER&lt;/EM&gt;. &lt;BR /&gt;
but as this result, &lt;CODE&gt;where&lt;/CODE&gt; handles to display the results.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Apr 2020 19:05:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-top-10-values-using-timechart/m-p/321453#M96029</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-04-29T19:05:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the top 10 values using timechart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-top-10-values-using-timechart/m-p/321454#M96030</link>
      <description>&lt;P&gt;i) "in default, timechart displays 5 fields and OTHER". Would you be able to point to the Splunk documentation where the limit of '5' fields is mentioned? Because I couldn't find this in the documentation.&lt;/P&gt;

&lt;P&gt;ii) What about "NULL" and "null". Why do those appear? When I follow @madrum's recommendation above, I do &lt;STRONG&gt;not&lt;/STRONG&gt; see any nulls. Not sure if NULLs gets added as extra counts if not removed, or filter out actual results, if removed.&lt;/P&gt;

&lt;P&gt;iii) The thing to remember with the 'where' clause is that, the count of that parameter is across the ENTIRE series of the timechart and not across INDIVIDUAL time epocs. So, for example, taking your example above, if one time-interval had 40 'max' values, with only 10 of them falling within the top 26 values in the series, this 40-'max'-value-time-interval will show only those 10 values. It will not show &lt;STRONG&gt;26&lt;/STRONG&gt; out of the 40 values. So, the '26' is a TOTAL number and applies ACROSS the series.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2020 10:37:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-top-10-values-using-timechart/m-p/321454#M96030</guid>
      <dc:creator>rey123</dc:creator>
      <dc:date>2020-04-30T10:37:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the top 10 values using timechart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-top-10-values-using-timechart/m-p/321455#M96031</link>
      <description>&lt;OL&gt;
&lt;LI&gt;the comparison &lt;CODE&gt;| timechart cont=f max(counts) by host where max in top26&lt;/CODE&gt; and &lt;CODE&gt;| timechart cont=f max(counts) by host&lt;/CODE&gt;&lt;/LI&gt;
&lt;LI&gt;In your search, if event don't have the searching field , &lt;CODE&gt;null&lt;/CODE&gt; is appear.
 If you use &lt;CODE&gt;stats count&lt;/CODE&gt; (event count) , the result will be wrong result.&lt;/LI&gt;
&lt;LI&gt;&lt;CODE&gt;ENTIRE series&lt;/CODE&gt; yes. the requirement.
&lt;CODE&gt;not across INDIVIDUAL time epochs.&lt;/CODE&gt; why do you use &lt;CODE&gt;timechart where&lt;/CODE&gt; for this?
your usage is wrong. &lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Fri, 01 May 2020 11:30:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-top-10-values-using-timechart/m-p/321455#M96031</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-05-01T11:30:26Z</dc:date>
    </item>
  </channel>
</rss>

