<?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 my table columns? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-sort-my-table-columns/m-p/317123#M94876</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;One way you could sort this, would be to extract the number from the field containing "Row" and then sort by that number.&lt;/P&gt;

&lt;P&gt;For example, assuming your "Row" field is called "row_no":&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field="row_no" "Row(?&amp;lt;row_sort&amp;gt;\d+)"
| sort + row_sort
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you didn't want the "sort" field afterwards, you could then remove it with:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| fields - row_sort
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;To see a full example, try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults
| fields - _time
| eval row_no=mvrange(1,34) | mvexpand row_no | eval row_no="Row".row_no
| rex field="row_no" "Row(?&amp;lt;row_sort&amp;gt;\d+)"
| sort + row_sort
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hopefully that will get you the result that you're looking for.&lt;/P&gt;</description>
    <pubDate>Fri, 24 Feb 2017 10:19:23 GMT</pubDate>
    <dc:creator>gvmorley</dc:creator>
    <dc:date>2017-02-24T10:19:23Z</dc:date>
    <item>
      <title>How to sort my table columns?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-sort-my-table-columns/m-p/317121#M94874</link>
      <description>&lt;P&gt;Can someone help in  sorting table columns.  Table contains &lt;BR /&gt;
Row1,Row2,Row3,Row11,Row22,Row33&lt;BR /&gt;
I tried sorting in order. &lt;STRONG&gt;but it shows below&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Row1&lt;BR /&gt;
Row11&lt;BR /&gt;
Row2&lt;BR /&gt;
Row22&lt;BR /&gt;
Row3&lt;BR /&gt;
Row33&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Result should be&lt;/STRONG&gt; - &lt;BR /&gt;
Row1&lt;BR /&gt;
Row2&lt;BR /&gt;
Row3&lt;BR /&gt;
Row11&lt;BR /&gt;
Row22&lt;BR /&gt;
Row33&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2017 05:13:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-sort-my-table-columns/m-p/317121#M94874</guid>
      <dc:creator>vnithin123</dc:creator>
      <dc:date>2017-02-24T05:13:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to sort my table columns?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-sort-my-table-columns/m-p/317122#M94875</link>
      <description>&lt;P&gt;What is your query?&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2017 10:02:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-sort-my-table-columns/m-p/317122#M94875</guid>
      <dc:creator>jlvix1</dc:creator>
      <dc:date>2017-02-24T10:02:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to sort my table columns?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-sort-my-table-columns/m-p/317123#M94876</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;One way you could sort this, would be to extract the number from the field containing "Row" and then sort by that number.&lt;/P&gt;

&lt;P&gt;For example, assuming your "Row" field is called "row_no":&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field="row_no" "Row(?&amp;lt;row_sort&amp;gt;\d+)"
| sort + row_sort
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you didn't want the "sort" field afterwards, you could then remove it with:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| fields - row_sort
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;To see a full example, try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults
| fields - _time
| eval row_no=mvrange(1,34) | mvexpand row_no | eval row_no="Row".row_no
| rex field="row_no" "Row(?&amp;lt;row_sort&amp;gt;\d+)"
| sort + row_sort
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hopefully that will get you the result that you're looking for.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2017 10:19:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-sort-my-table-columns/m-p/317123#M94876</guid>
      <dc:creator>gvmorley</dc:creator>
      <dc:date>2017-02-24T10:19:23Z</dc:date>
    </item>
  </channel>
</rss>

