<?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: sort column based on dynamic parameters in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/sort-column-based-on-dynamic-parameters/m-p/431978#M169146</link>
    <description>&lt;P&gt;Two things that are weird, &lt;BR /&gt;
1. In  " |  table Id description 1* 2* 3* 4* " : I want  numbers to be added dynamically&lt;BR /&gt;
2. In "|  rename "&lt;EM&gt;detail" as "detail&lt;/EM&gt;", "&lt;EM&gt;price" as "price&lt;/EM&gt;" " : ruins the table format an get back to same old format. &lt;/P&gt;</description>
    <pubDate>Wed, 30 May 2018 20:27:25 GMT</pubDate>
    <dc:creator>krishman23</dc:creator>
    <dc:date>2018-05-30T20:27:25Z</dc:date>
    <item>
      <title>sort column based on dynamic parameters</title>
      <link>https://community.splunk.com/t5/Splunk-Search/sort-column-based-on-dynamic-parameters/m-p/431976#M169144</link>
      <description>&lt;P&gt;My table has variable  columns size as &lt;BR /&gt;
Id, description, detail1,  detail2, detail3,  detail4, price1, price2, price3, price4, &lt;/P&gt;

&lt;P&gt;here detail has price related to the number at the end&lt;BR /&gt;
some row may have  1 details and some may have 2 or more, but will be in detail - price pair&lt;/P&gt;

&lt;P&gt;I want my table in format&lt;BR /&gt;
id, description, detail1, price1, detail2, price2 ... &lt;/P&gt;</description>
      <pubDate>Wed, 30 May 2018 18:29:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/sort-column-based-on-dynamic-parameters/m-p/431976#M169144</guid>
      <dc:creator>krishman23</dc:creator>
      <dc:date>2018-05-30T18:29:42Z</dc:date>
    </item>
    <item>
      <title>Re: sort column based on dynamic parameters</title>
      <link>https://community.splunk.com/t5/Splunk-Search/sort-column-based-on-dynamic-parameters/m-p/431977#M169145</link>
      <description>&lt;P&gt;@krishman23, please add the following three pipes to your existing search and see:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt;yourCurrentSearchWithOutputTable&amp;gt;
|  rename "detail*" as "*detail", "price*" as "*price"
|  table Id description 1* 2* 3* 4*
|  rename "*detail" as "detail*", "*price" as "price*"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Following is a run anywhere example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|  makeresults
|  eval _raw="Id=2327163, description=\"some desc\", detail1=\"detail 1\", detail2=\"deatil 2\", detail3=\"detail 3\", detail4=\"detail 4\", price1=\"price 1\", price2=\"price 2\", price3=\"price 3\", price4=\"price 4\""
|  KV
|  fields - _*
|  rename "detail*" as "*detail", "price*" as "*price"
|  table Id description 1* 2* 3* 4*
|  rename "*detail" as "detail*", "*price" as "price*"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;PS: If you are using some transforming command/s to arrive to the sequence of fields as in your question, do share your query for us to see if this sequence of columns can be handled before showing the above results.&lt;/P&gt;</description>
      <pubDate>Wed, 30 May 2018 19:03:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/sort-column-based-on-dynamic-parameters/m-p/431977#M169145</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-05-30T19:03:58Z</dc:date>
    </item>
    <item>
      <title>Re: sort column based on dynamic parameters</title>
      <link>https://community.splunk.com/t5/Splunk-Search/sort-column-based-on-dynamic-parameters/m-p/431978#M169146</link>
      <description>&lt;P&gt;Two things that are weird, &lt;BR /&gt;
1. In  " |  table Id description 1* 2* 3* 4* " : I want  numbers to be added dynamically&lt;BR /&gt;
2. In "|  rename "&lt;EM&gt;detail" as "detail&lt;/EM&gt;", "&lt;EM&gt;price" as "price&lt;/EM&gt;" " : ruins the table format an get back to same old format. &lt;/P&gt;</description>
      <pubDate>Wed, 30 May 2018 20:27:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/sort-column-based-on-dynamic-parameters/m-p/431978#M169146</guid>
      <dc:creator>krishman23</dc:creator>
      <dc:date>2018-05-30T20:27:25Z</dc:date>
    </item>
    <item>
      <title>Re: sort column based on dynamic parameters</title>
      <link>https://community.splunk.com/t5/Splunk-Search/sort-column-based-on-dynamic-parameters/m-p/431979#M169147</link>
      <description>&lt;P&gt;Can you just use the following table pipe in second last command and remove the final rename?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|  table Id description *
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Also while posting code use the &lt;CODE&gt;code button&lt;/CODE&gt; (i.e. &lt;CODE&gt;101010&lt;/CODE&gt;) or shortcut key &lt;CODE&gt;Ctrl+K&lt;/CODE&gt; to ensure that special character does not escape.&lt;/P&gt;</description>
      <pubDate>Wed, 30 May 2018 21:33:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/sort-column-based-on-dynamic-parameters/m-p/431979#M169147</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-05-30T21:33:51Z</dc:date>
    </item>
    <item>
      <title>Re: sort column based on dynamic parameters</title>
      <link>https://community.splunk.com/t5/Splunk-Search/sort-column-based-on-dynamic-parameters/m-p/431980#M169148</link>
      <description>&lt;P&gt;Are the number suffix on &lt;CODE&gt;details*&lt;/CODE&gt; and &lt;CODE&gt;price*&lt;/CODE&gt; columns fixed?&lt;/P&gt;</description>
      <pubDate>Wed, 30 May 2018 21:43:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/sort-column-based-on-dynamic-parameters/m-p/431980#M169148</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-05-30T21:43:04Z</dc:date>
    </item>
  </channel>
</rss>

