<?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 do you sort columns within a column? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-sort-columns-within-a-column/m-p/366625#M108146</link>
    <description>&lt;P&gt;If you mark your data as code, then the interface will not slam it all to the left like that.&lt;/P&gt;</description>
    <pubDate>Thu, 29 Jun 2017 19:13:43 GMT</pubDate>
    <dc:creator>DalJeanis</dc:creator>
    <dc:date>2017-06-29T19:13:43Z</dc:date>
    <item>
      <title>How do you sort columns within a column?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-sort-columns-within-a-column/m-p/366622#M108143</link>
      <description>&lt;P&gt;For example&lt;/P&gt;

&lt;P&gt;Name                        Code     Pool&lt;BR /&gt;
Name1           100         p1&lt;BR /&gt;
                57      p32&lt;BR /&gt;
                63      p43&lt;BR /&gt;
                230     p27&lt;/P&gt;

&lt;P&gt;Name2           120         p2&lt;BR /&gt;
                77      p33&lt;BR /&gt;
                83      p44&lt;BR /&gt;
                250     p28&lt;/P&gt;

&lt;P&gt;should become               &lt;/P&gt;

&lt;P&gt;Name                        Code     Pool&lt;BR /&gt;
Name1           230     p27&lt;BR /&gt;
                100      p1&lt;BR /&gt;
                63      p43&lt;BR /&gt;
                57      p32&lt;/P&gt;

&lt;P&gt;Name2           250     p28 &lt;BR /&gt;
                120      p2&lt;BR /&gt;
                83      p44&lt;BR /&gt;
                77      p33&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jun 2017 18:50:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-sort-columns-within-a-column/m-p/366622#M108143</guid>
      <dc:creator>psangli</dc:creator>
      <dc:date>2017-06-29T18:50:12Z</dc:date>
    </item>
    <item>
      <title>Re: How do you sort columns within a column?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-sort-columns-within-a-column/m-p/366623#M108144</link>
      <description>&lt;P&gt;It would've been better if you had posted your current search generating those output. Assuming that your last command was something on the lines of  &lt;CODE&gt;..| stats list(Code) as Code list(Pool) as Pool by Name&lt;/CODE&gt; OR &lt;CODE&gt;..| stats values(Code) as Code values(Pool) as Pool by Name&lt;/CODE&gt;, give this a try..&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your current search before the last stats
| sort 0 Name -Code 
| stats list(Code) as Code list(Pool) as Pool by Name
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 29 Jun 2017 19:11:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-sort-columns-within-a-column/m-p/366623#M108144</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-06-29T19:11:03Z</dc:date>
    </item>
    <item>
      <title>Re: How do you sort columns within a column?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-sort-columns-within-a-column/m-p/366624#M108145</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|makeresults | eval raw="Name1 100 p1
Name1 57 p32
Name1 63 p43
Name1 230 p27
Name2 120 p2
Name2 77 p33
Name2 83 p44
Name2 250 p28"
| makemv delim="
" raw
| mvexpand raw
| rename raw AS _raw
| rex "^(?&amp;lt;Name&amp;gt;\S+)\s+(?&amp;lt;Code&amp;gt;\S+)\s+(?&amp;lt;Pool&amp;gt;\S+)$"
| stats count BY Name Code Pool
| stats list(*) AS * BY Name

| rename COMMENT AS "Everything above generates sample event data; everything below is your solution"

| eval Combo=mvzip(Code, Pool)
| fields Name Combo
| mvexpand Combo
| rex field=Combo "^(?&amp;lt;Code&amp;gt;[^,]+),(?&amp;lt;Pool&amp;gt;.*)$"
| sort 0 - Code
| fields - Combo
| stats list(*) AS * BY Name
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 29 Jun 2017 19:12:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-sort-columns-within-a-column/m-p/366624#M108145</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-06-29T19:12:51Z</dc:date>
    </item>
    <item>
      <title>Re: How do you sort columns within a column?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-sort-columns-within-a-column/m-p/366625#M108146</link>
      <description>&lt;P&gt;If you mark your data as code, then the interface will not slam it all to the left like that.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jun 2017 19:13:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-sort-columns-within-a-column/m-p/366625#M108146</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-06-29T19:13:43Z</dc:date>
    </item>
  </channel>
</rss>

