<?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 rank data based on field value? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-rank-data-based-on-field-value/m-p/500706#M139404</link>
    <description>&lt;P&gt;Fiendishly clever!&lt;/P&gt;</description>
    <pubDate>Thu, 26 Mar 2020 16:30:12 GMT</pubDate>
    <dc:creator>rmmiller</dc:creator>
    <dc:date>2020-03-26T16:30:12Z</dc:date>
    <item>
      <title>How to rank data based on field value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-rank-data-based-on-field-value/m-p/500703#M139401</link>
      <description>&lt;P&gt;I've got data say in following format (*there may be more than three types of exception)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;     Name,Exception,count
     Jack,Null Pointer Exception,10
     Jack,Number Format Exception,10
     Jack,Other Exception,10
     Tom,Null Pointer Exception,20
     Tom,Number Format Exception,20
     Tom,Other Exception,20
     Dave,Null Pointer Exception,30
     Dave,Number Format Exception,30
     Dave,Other Exception,30
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Required output is something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Name, Rank for Null Pointer Exception, Rank for Number format Exception...
Jack , 3 , 3 , 3
Tom , 2 , 2 , 2
Dave , 1 , 1 , 1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Any simple SPL can you suggest? Thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2020 13:06:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-rank-data-based-on-field-value/m-p/500703#M139401</guid>
      <dc:creator>s20071035</dc:creator>
      <dc:date>2020-03-26T13:06:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to rank data based on field value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-rank-data-based-on-field-value/m-p/500704#M139402</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|makeresults | eval _raw="Name,Exception,count
Jack,Null Pointer Exception,10
Jack,Number Format Exception,10
Jack,Other Exception,10
Tom,Null Pointer Exception,20
Tom,Number Format Exception,20
Tom,Other Exception,20
Dave,Null Pointer Exception,30
Dave,Number Format Exception,30
Dave,Other Exception,30"
| multikv forceheader=1

| rename COMMENT AS "Everything above generates sample event data; everything below is your solution"

| stats sum(count) AS count BY Name Exception
| sort 0 - count
| streamstats count AS rank BY Exception
| rename COMMENT AS "Handle ties"
| eventstats first(rank) AS rank BY count
| chart first(rank) BY Name Exception
| rename *Exception AS "rank for *Exception"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 26 Mar 2020 16:08:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-rank-data-based-on-field-value/m-p/500704#M139402</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2020-03-26T16:08:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to rank data based on field value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-rank-data-based-on-field-value/m-p/500705#M139403</link>
      <description>&lt;P&gt;Thank you so much for your help!&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2020 16:29:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-rank-data-based-on-field-value/m-p/500705#M139403</guid>
      <dc:creator>s20071035</dc:creator>
      <dc:date>2020-03-26T16:29:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to rank data based on field value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-rank-data-based-on-field-value/m-p/500706#M139404</link>
      <description>&lt;P&gt;Fiendishly clever!&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2020 16:30:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-rank-data-based-on-field-value/m-p/500706#M139404</guid>
      <dc:creator>rmmiller</dc:creator>
      <dc:date>2020-03-26T16:30:12Z</dc:date>
    </item>
  </channel>
</rss>

