<?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 data on the basis of each field using splunk SQL. in Knowledge Management</title>
    <link>https://community.splunk.com/t5/Knowledge-Management/How-to-sort-data-on-the-basis-of-each-field-using-splunk-SQL/m-p/69160#M7282</link>
    <description>&lt;P&gt;First of all, Splunk does not use SQL. It has its own search language.&lt;/P&gt;

&lt;P&gt;Second, could you explain more clearly what you'd like to do? You have your table consisting of various columns, what's stopping you from sorting?&lt;/P&gt;</description>
    <pubDate>Mon, 24 Sep 2012 23:02:41 GMT</pubDate>
    <dc:creator>Ayn</dc:creator>
    <dc:date>2012-09-24T23:02:41Z</dc:date>
    <item>
      <title>How to sort data on the basis of each field using splunk SQL.</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-to-sort-data-on-the-basis-of-each-field-using-splunk-SQL/m-p/69159#M7281</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;CustomerID             Time              CrashCount        EventDescription     
20:12:13:14:0A:45   09/19/2012 20:12:13.1   07       Poor IB SNR                
20:12:13:14:0A:42   09/19/2012 20:12:13.1   04           HDD FULL           
20:12:13:14:0A:45   09/19/2012 20:12:13.1   07       Poor IB SNR                       20:12:13:14:0A:45    09/19/2012 20:12:13.1   02           HDD FULL               
20:12:13:14:0A:41   09/19/2012 20:12:13.1   05       Poor IB SNR    
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have a data of the type shown above. The search that is generating this data is: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt;param name="search"&amp;gt;sourcetype="$sourcetype$" 
    | spath path="EID" output=EventID 
    | spath path="CT" output=Critical 
    | spath path="SID" output=StbID 
    | search EventID="$EventID$" 
    | search Critical="$Critical$" 
    | search StbID="*" 
    | fields - _raw 
    | fields +  StbID, _time, EventID 
    | join type=inner EventID 
      [ SEARCH sourcetype="jsonformat" 
      | spath path="EID" output=EventID 
      | spath path="EventDescription" output=EventDescription 
      | FIELDS EventID, EventDescription ] 
    | rename _time AS "Time", StbID AS "CustomerID" 
    | convert ctime(Time) 
    | search EventDescription="VMS*" 
    | join type=inner EventID 
       [ SEARCH sourcetype="jsonxmlall" 
       | spath path="EID" output=EventID
       | spath path="CNT" output=CrashCount 
       | spath path="LPD" output=LeakPerDay 
       | spath path="IO" output=IOwait 
       | spath path="SNR" output=SNRValue 
       | spath path="TMP" output=HardDiskTemp 
       | fields EventID, CrashCount, LeakPerDay, IOwait, SNRValue, HardDiskTemp ]
  &amp;lt;/param&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I need to sort this search on the basis of each column. Can you help me how to achieve that as I have tried so many things but not able to do that.&lt;/P&gt;

&lt;P&gt;Thanks in advance.          &lt;/P&gt;</description>
      <pubDate>Mon, 24 Sep 2012 22:51:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-to-sort-data-on-the-basis-of-each-field-using-splunk-SQL/m-p/69159#M7281</guid>
      <dc:creator>disha</dc:creator>
      <dc:date>2012-09-24T22:51:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to sort data on the basis of each field using splunk SQL.</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-to-sort-data-on-the-basis-of-each-field-using-splunk-SQL/m-p/69160#M7282</link>
      <description>&lt;P&gt;First of all, Splunk does not use SQL. It has its own search language.&lt;/P&gt;

&lt;P&gt;Second, could you explain more clearly what you'd like to do? You have your table consisting of various columns, what's stopping you from sorting?&lt;/P&gt;</description>
      <pubDate>Mon, 24 Sep 2012 23:02:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-to-sort-data-on-the-basis-of-each-field-using-splunk-SQL/m-p/69160#M7282</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-09-24T23:02:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to sort data on the basis of each field using splunk SQL.</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-to-sort-data-on-the-basis-of-each-field-using-splunk-SQL/m-p/69161#M7283</link>
      <description>&lt;P&gt;Yes I understand Splunk has its own search engine. I am trying to sort the data of each column but when I am adding SORT -fieldname, it is sorting the column names not the data as &lt;BR /&gt;
"custid time event count" is getting sortred as "count custid event time" not the data of these fields.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Sep 2012 23:11:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-to-sort-data-on-the-basis-of-each-field-using-splunk-SQL/m-p/69161#M7283</guid>
      <dc:creator>disha</dc:creator>
      <dc:date>2012-09-24T23:11:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to sort data on the basis of each field using splunk SQL.</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-to-sort-data-on-the-basis-of-each-field-using-splunk-SQL/m-p/69162#M7284</link>
      <description>&lt;P&gt;If you have the table you showed at the top, just adding a &lt;CODE&gt;| sort - field&lt;/CODE&gt; should do what you want. Additionally you could just click directly in the table headers for sorting.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Sep 2012 06:05:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-to-sort-data-on-the-basis-of-each-field-using-splunk-SQL/m-p/69162#M7284</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-09-25T06:05:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to sort data on the basis of each field using splunk SQL.</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-to-sort-data-on-the-basis-of-each-field-using-splunk-SQL/m-p/69163#M7285</link>
      <description>&lt;P&gt;Yes, I have done that but the funny thing is happening as it is sorting the field data but as well as it is sorting the column names also I wrote above like "custid time event count" is getting sortred as "count custid event time". Can you tell me why it is happening or how we can fix that. This simplest thing is getting stuck from two days..:(&lt;/P&gt;</description>
      <pubDate>Tue, 25 Sep 2012 16:58:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-to-sort-data-on-the-basis-of-each-field-using-splunk-SQL/m-p/69163#M7285</guid>
      <dc:creator>disha</dc:creator>
      <dc:date>2012-09-25T16:58:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to sort data on the basis of each field using splunk SQL.</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-to-sort-data-on-the-basis-of-each-field-using-splunk-SQL/m-p/69164#M7286</link>
      <description>&lt;P&gt;@disha,&lt;/P&gt;

&lt;P&gt;Perhaps you could show sample output that is in your table.  Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Sep 2012 17:04:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-to-sort-data-on-the-basis-of-each-field-using-splunk-SQL/m-p/69164#M7286</guid>
      <dc:creator>melting</dc:creator>
      <dc:date>2012-09-25T17:04:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to sort data on the basis of each field using splunk SQL.</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-to-sort-data-on-the-basis-of-each-field-using-splunk-SQL/m-p/69165#M7287</link>
      <description>&lt;P&gt;CustomerID  Time    EventID CrashCount EventDescription HardDiskTemp    IOwait  LeakPerDay  SNRValue&lt;BR /&gt;
1   10:12:13:14:0A:46   09/19/2012 19:30:40 09      VMS: HDD Full&lt;BR /&gt;&lt;BR /&gt;
2   10:12:13:14:0A:46   09/19/2012 19:30:40 09      VMS: HDD Full&lt;BR /&gt;&lt;BR /&gt;
after putting | sort EventID ..The output is&lt;BR /&gt;
CrashCount CustomerID EventDescription EventID  HardDiskTemp    IOwait  LeakPerDay SNRValue Time&lt;BR /&gt;
1   2   10:12:13:14:0A:20   VMS: Stack Crash    02                  09/19/2012 19:30:05&lt;BR /&gt;
2   2   10:12:13:14:0A:20   VMS: Stack Crash    03&lt;BR /&gt;
As you can see that output is sorted out on the basis of EventID but the field names are also rearranged in sorted order which is wrong.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Sep 2012 17:54:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-to-sort-data-on-the-basis-of-each-field-using-splunk-SQL/m-p/69165#M7287</guid>
      <dc:creator>disha</dc:creator>
      <dc:date>2012-09-25T17:54:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to sort data on the basis of each field using splunk SQL.</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-to-sort-data-on-the-basis-of-each-field-using-splunk-SQL/m-p/69166#M7288</link>
      <description>&lt;P&gt;I am not sure why the field order is also getting sorted.  Perhaps running the sort then the table command will put things right.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | sort EventID | Table CustomerID Time EventID ....
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 25 Sep 2012 18:04:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-to-sort-data-on-the-basis-of-each-field-using-splunk-SQL/m-p/69166#M7288</guid>
      <dc:creator>melting</dc:creator>
      <dc:date>2012-09-25T18:04:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to sort data on the basis of each field using splunk SQL.</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-to-sort-data-on-the-basis-of-each-field-using-splunk-SQL/m-p/69167#M7289</link>
      <description>&lt;P&gt;This is working. Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 25 Sep 2012 20:21:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-to-sort-data-on-the-basis-of-each-field-using-splunk-SQL/m-p/69167#M7289</guid>
      <dc:creator>disha</dc:creator>
      <dc:date>2012-09-25T20:21:41Z</dc:date>
    </item>
  </channel>
</rss>

