<?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: Top n plus others in Splunk Enterprise</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise/Top-n-plus-others/m-p/507666#M2451</link>
    <description>&lt;P&gt;Hi,&lt;BR /&gt;Thanks for your response. I forgot about the limit=n in the timechart command. Thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;To complement your response I just added this after the timeshare command&lt;BR /&gt;&lt;BR /&gt;| timechart span=1d limit=1000 sum(count) by text&amp;nbsp;&lt;BR /&gt;| transpose&lt;BR /&gt;| search NOT column=_span NOT column=_time&lt;BR /&gt;| rename "row 1" as count&lt;BR /&gt;| sort - count&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 06 Jul 2020 20:04:13 GMT</pubDate>
    <dc:creator>lpolo</dc:creator>
    <dc:date>2020-07-06T20:04:13Z</dc:date>
    <item>
      <title>Top n plus others</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Top-n-plus-others/m-p/507655#M2449</link>
      <description>&lt;P&gt;Let's say we have the following log events:&lt;BR /&gt;&lt;BR /&gt;time1 text=g &amp;nbsp;count=82&lt;BR /&gt;time2 text=f &amp;nbsp;count=80&lt;BR /&gt;time3 text=c &amp;nbsp;count=14&lt;BR /&gt;time4 text=e &amp;nbsp;count=13&lt;BR /&gt;time5 text=b &amp;nbsp;count=11&lt;BR /&gt;time6 text=a &amp;nbsp;count=10&lt;BR /&gt;time7 text=d &amp;nbsp;count=6&lt;BR /&gt;&lt;BR /&gt;The following query will get the Top N results:&lt;BR /&gt;&lt;BR /&gt;earliest=time1 latest=time7 index=blabla |&lt;BR /&gt;stat sum(count) as count by text&lt;BR /&gt;&lt;BR /&gt;Result:&lt;BR /&gt;text | count&lt;BR /&gt;g &amp;nbsp; 82&lt;BR /&gt;f &amp;nbsp; 80&lt;BR /&gt;c &amp;nbsp;14&lt;BR /&gt;e &amp;nbsp;13&lt;BR /&gt;b &amp;nbsp;11&lt;BR /&gt;a &amp;nbsp;10&lt;BR /&gt;d &amp;nbsp;6&lt;BR /&gt;&lt;BR /&gt;I need a query to get the Top 3 plus others result example:&lt;BR /&gt;&lt;BR /&gt;text | count&lt;BR /&gt;g &amp;nbsp; 82&lt;BR /&gt;f &amp;nbsp; 80&lt;BR /&gt;c &amp;nbsp;14&lt;BR /&gt;others 40&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jul 2020 18:54:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Top-n-plus-others/m-p/507655#M2449</guid>
      <dc:creator>lpolo</dc:creator>
      <dc:date>2020-07-06T18:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: Top n plus others</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Top-n-plus-others/m-p/507659#M2450</link>
      <description>&lt;P&gt;See if this helps.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults | eval data="time1 text=g  count=82|time2 text=f  count=80|time3 text=c  count=14|time4 text=e  count=13|time5 text=b  count=11|time6 text=a  count=10|time7 text=d  count=6" | eval data=split(data,"|") | mvexpand data | eval _raw=data | extract pairdelim=" " kvdelim="="
`comment("Above just sets up test data")`
`comment("Get the top 3 counts and put everything else in 'other'")`
| timechart span=1d limit=3 useother=t sum(count) as count by text
`comment("Throw out fields we don't need")`
| fields - _*
`comment("Rotate the results")`
| transpose column_name="text" header_field=count
| rename "row 1" as count&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 06 Jul 2020 19:35:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Top-n-plus-others/m-p/507659#M2450</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-07-06T19:35:02Z</dc:date>
    </item>
    <item>
      <title>Re: Top n plus others</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Top-n-plus-others/m-p/507666#M2451</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;Thanks for your response. I forgot about the limit=n in the timechart command. Thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;To complement your response I just added this after the timeshare command&lt;BR /&gt;&lt;BR /&gt;| timechart span=1d limit=1000 sum(count) by text&amp;nbsp;&lt;BR /&gt;| transpose&lt;BR /&gt;| search NOT column=_span NOT column=_time&lt;BR /&gt;| rename "row 1" as count&lt;BR /&gt;| sort - count&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jul 2020 20:04:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Top-n-plus-others/m-p/507666#M2451</guid>
      <dc:creator>lpolo</dc:creator>
      <dc:date>2020-07-06T20:04:13Z</dc:date>
    </item>
  </channel>
</rss>

