<?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 Sorting the fields based on values in a row in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Sorting-the-fields-based-on-values-in-a-row/m-p/565563#M197058</link>
    <description>&lt;P&gt;&lt;SPAN&gt;This is my splunk query&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;index=xxxxx "searchTerm")|rex "someterm(?&amp;lt;errortype&amp;gt;)" | timechart count by&lt;BR /&gt;errortype span ="1w" | addcoltotals labelfield=total | fillnullvalue=TOTAL|fileds - abc,def,total&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am adding the total count of the errors over a week in another column named TOTAL as depicted in table below.Here A... B... are error names in alphabetical order, the values are total number of errors that occured on that day for that errortype&lt;/P&gt;&lt;P&gt;_time&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; A....&amp;nbsp; &amp;nbsp; &amp;nbsp;A....&amp;nbsp; &amp;nbsp; &amp;nbsp;C....&amp;nbsp; &amp;nbsp; &amp;nbsp;D....&amp;nbsp; &amp;nbsp; &amp;nbsp;E....&lt;/P&gt;&lt;P&gt;2021-08-25&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;11&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;22&amp;nbsp; &amp;nbsp; &amp;nbsp; 05&amp;nbsp; &amp;nbsp; &amp;nbsp; 23&amp;nbsp; &amp;nbsp; &amp;nbsp; 89&lt;BR /&gt;2021-08-26&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 15&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;45&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 45&amp;nbsp; &amp;nbsp; &amp;nbsp; 13&amp;nbsp; &amp;nbsp; &amp;nbsp; 39&lt;BR /&gt;2021-08-27&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 34&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;05&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 55&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;33&amp;nbsp; &amp;nbsp; &amp;nbsp;85&lt;BR /&gt;2021-08-28&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 56&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;08&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 65&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;53&amp;nbsp; &amp;nbsp; &amp;nbsp; 09&lt;BR /&gt;2021-08-29&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;01&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;06&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 95&amp;nbsp; &amp;nbsp; &amp;nbsp; 36&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;01&lt;BR /&gt;TOTAL&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 117&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 86&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;265&amp;nbsp; 158&amp;nbsp; &amp;nbsp; 223&lt;BR /&gt;I want these fields sorted by value in TOTAL row in descending order like&lt;/P&gt;&lt;P&gt;265&amp;nbsp; &amp;nbsp;223 1 58&amp;nbsp; 117&amp;nbsp; 86&lt;BR /&gt;But i am always getting this in alphabetical order of the errortype like&lt;/P&gt;&lt;P&gt;A... A... B...&lt;BR /&gt;how can i improve this query to get the sorted result like i want?&lt;/P&gt;</description>
    <pubDate>Thu, 02 Sep 2021 01:17:20 GMT</pubDate>
    <dc:creator>nsingh49</dc:creator>
    <dc:date>2021-09-02T01:17:20Z</dc:date>
    <item>
      <title>Sorting the fields based on values in a row</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Sorting-the-fields-based-on-values-in-a-row/m-p/565563#M197058</link>
      <description>&lt;P&gt;&lt;SPAN&gt;This is my splunk query&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;index=xxxxx "searchTerm")|rex "someterm(?&amp;lt;errortype&amp;gt;)" | timechart count by&lt;BR /&gt;errortype span ="1w" | addcoltotals labelfield=total | fillnullvalue=TOTAL|fileds - abc,def,total&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am adding the total count of the errors over a week in another column named TOTAL as depicted in table below.Here A... B... are error names in alphabetical order, the values are total number of errors that occured on that day for that errortype&lt;/P&gt;&lt;P&gt;_time&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; A....&amp;nbsp; &amp;nbsp; &amp;nbsp;A....&amp;nbsp; &amp;nbsp; &amp;nbsp;C....&amp;nbsp; &amp;nbsp; &amp;nbsp;D....&amp;nbsp; &amp;nbsp; &amp;nbsp;E....&lt;/P&gt;&lt;P&gt;2021-08-25&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;11&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;22&amp;nbsp; &amp;nbsp; &amp;nbsp; 05&amp;nbsp; &amp;nbsp; &amp;nbsp; 23&amp;nbsp; &amp;nbsp; &amp;nbsp; 89&lt;BR /&gt;2021-08-26&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 15&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;45&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 45&amp;nbsp; &amp;nbsp; &amp;nbsp; 13&amp;nbsp; &amp;nbsp; &amp;nbsp; 39&lt;BR /&gt;2021-08-27&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 34&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;05&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 55&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;33&amp;nbsp; &amp;nbsp; &amp;nbsp;85&lt;BR /&gt;2021-08-28&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 56&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;08&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 65&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;53&amp;nbsp; &amp;nbsp; &amp;nbsp; 09&lt;BR /&gt;2021-08-29&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;01&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;06&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 95&amp;nbsp; &amp;nbsp; &amp;nbsp; 36&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;01&lt;BR /&gt;TOTAL&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 117&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 86&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;265&amp;nbsp; 158&amp;nbsp; &amp;nbsp; 223&lt;BR /&gt;I want these fields sorted by value in TOTAL row in descending order like&lt;/P&gt;&lt;P&gt;265&amp;nbsp; &amp;nbsp;223 1 58&amp;nbsp; 117&amp;nbsp; 86&lt;BR /&gt;But i am always getting this in alphabetical order of the errortype like&lt;/P&gt;&lt;P&gt;A... A... B...&lt;BR /&gt;how can i improve this query to get the sorted result like i want?&lt;/P&gt;</description>
      <pubDate>Thu, 02 Sep 2021 01:17:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Sorting-the-fields-based-on-values-in-a-row/m-p/565563#M197058</guid>
      <dc:creator>nsingh49</dc:creator>
      <dc:date>2021-09-02T01:17:20Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting the fields based on values in a row</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Sorting-the-fields-based-on-values-in-a-row/m-p/565586#M197062</link>
      <description>&lt;P&gt;You could transpose, then sort, then transpose back.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Sep 2021 04:32:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Sorting-the-fields-based-on-values-in-a-row/m-p/565586#M197062</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2021-09-02T04:32:06Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting the fields based on values in a row</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Sorting-the-fields-based-on-values-in-a-row/m-p/565695#M197109</link>
      <description>&lt;P&gt;added this to the query this and worked like a charm&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;| addcoltotals labelfield=_time label="TOTAL"&lt;BR /&gt;| transpose header_field="_time" 0&lt;BR /&gt;| sort - TOTAL&lt;BR /&gt;| transpose header_field="column" 0&lt;BR /&gt;| rename column as _time&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Sep 2021 16:13:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Sorting-the-fields-based-on-values-in-a-row/m-p/565695#M197109</guid>
      <dc:creator>nsingh49</dc:creator>
      <dc:date>2021-09-02T16:13:14Z</dc:date>
    </item>
  </channel>
</rss>

