<?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 sort severity in search? in Splunk Enterprise</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-sort-severity-in-search/m-p/415855#M1353</link>
    <description>&lt;P&gt;@Ropermark you can try out the following SPL&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=server-farm Risk=Critical OR Risk=High OR Risk=Medium OR Risk=Low 
| chart count by index, Risk
| rename Low as "1.Low",Medium as "2.Medium",High as "3.High",Critical as "4.Critical"
| table index 1.* 2.* 3.* 4.*
| rename 1.* as *, 2.* as *, 3.* as *, 4.* as *
| addtotals
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Following is a run anywhere search example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults
| eval data="Risk=Critical,index=a OR Risk=High,index=a OR Risk=Medium,index=b OR Risk=Low,index=b OR Risk=Critical,index=b OR Risk=High,index=b OR Risk=Medium,index=b OR Risk=Low,index=b"
| makemv data delim=" OR "
| mvexpand data
| rename data as _raw
| KV
| chart count by index, Risk
| rename Low as "1.Low",Medium as "2.Medium",High as "3.High",Critical as "4.Critical"
| table index 1.* 2.* 3.* 4.*
| rename 1.* as *, 2.* as *, 3.* as *, 4.* as *
| addtotals
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 20 Aug 2018 16:06:50 GMT</pubDate>
    <dc:creator>niketn</dc:creator>
    <dc:date>2018-08-20T16:06:50Z</dc:date>
    <item>
      <title>How to sort severity in search?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-sort-severity-in-search/m-p/415853#M1351</link>
      <description>&lt;P&gt;Hello all, &lt;/P&gt;

&lt;P&gt;I am very new to Splunk and I am looking to sort by the following command:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=server-farm Risk=Critical OR Risk=High OR Risk=Medium OR Risk=Low | chart count by index, Risk | addtotals
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But the problem is when I see the result I see in the following order:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index  - Critical - High - Low - Medium - Total
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to sort that in:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Index - Critical - High - Medium - Total 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Could someone please help me how to sort that. &lt;/P&gt;

&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Aug 2018 14:22:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-sort-severity-in-search/m-p/415853#M1351</guid>
      <dc:creator>Ropermark</dc:creator>
      <dc:date>2018-08-20T14:22:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to sort severity in search?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-sort-severity-in-search/m-p/415854#M1352</link>
      <description>&lt;P&gt;I suspect someone may be able to come up with a cleaner way, however this is the kind of approach I have taken in the past to this kind of issue.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=server-farm Risk=Critical OR Risk=High OR Risk=Medium OR Risk=Low | &lt;BR /&gt;
eval Risk=if(Risk="Critical","1:". Risk,if(Risk="High","2:". Risk,if(Risk="Medium","3:". Risk,"4:". Risk))) |&lt;BR /&gt;
chart count by index, Risk | &lt;BR /&gt;
rex field=Risk "[0-9]+:(?.+)" |&lt;BR /&gt;
addtotals&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Aug 2018 15:56:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-sort-severity-in-search/m-p/415854#M1352</guid>
      <dc:creator>tomawest</dc:creator>
      <dc:date>2018-08-20T15:56:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to sort severity in search?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-sort-severity-in-search/m-p/415855#M1353</link>
      <description>&lt;P&gt;@Ropermark you can try out the following SPL&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=server-farm Risk=Critical OR Risk=High OR Risk=Medium OR Risk=Low 
| chart count by index, Risk
| rename Low as "1.Low",Medium as "2.Medium",High as "3.High",Critical as "4.Critical"
| table index 1.* 2.* 3.* 4.*
| rename 1.* as *, 2.* as *, 3.* as *, 4.* as *
| addtotals
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Following is a run anywhere search example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults
| eval data="Risk=Critical,index=a OR Risk=High,index=a OR Risk=Medium,index=b OR Risk=Low,index=b OR Risk=Critical,index=b OR Risk=High,index=b OR Risk=Medium,index=b OR Risk=Low,index=b"
| makemv data delim=" OR "
| mvexpand data
| rename data as _raw
| KV
| chart count by index, Risk
| rename Low as "1.Low",Medium as "2.Medium",High as "3.High",Critical as "4.Critical"
| table index 1.* 2.* 3.* 4.*
| rename 1.* as *, 2.* as *, 3.* as *, 4.* as *
| addtotals
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 20 Aug 2018 16:06:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-sort-severity-in-search/m-p/415855#M1353</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-08-20T16:06:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to sort severity in search?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-sort-severity-in-search/m-p/415856#M1354</link>
      <description>&lt;P&gt;Hello thanks for the reply..&lt;BR /&gt;
But the problem is always same.&lt;/P&gt;

&lt;P&gt;the result query answer is &lt;/P&gt;

&lt;P&gt;Index | Critial | High | Low | Medium | Total&lt;/P&gt;

&lt;P&gt;i want low after medium, in this way my graph will be what i want. &lt;/P&gt;

&lt;P&gt;thanks for your help&lt;/P&gt;</description>
      <pubDate>Fri, 24 Aug 2018 14:20:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-sort-severity-in-search/m-p/415856#M1354</guid>
      <dc:creator>Ropermark</dc:creator>
      <dc:date>2018-08-24T14:20:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to sort severity in search?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-sort-severity-in-search/m-p/415857#M1355</link>
      <description>&lt;P&gt;Then use &lt;CODE&gt;rename "1.Medium", "2.Low"...&lt;/CODE&gt; in the above SPL.&lt;/P&gt;</description>
      <pubDate>Sat, 25 Aug 2018 18:36:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-sort-severity-in-search/m-p/415857#M1355</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-08-25T18:36:47Z</dc:date>
    </item>
  </channel>
</rss>

