<?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: DB Connect: How to prevent append command from sorting columns in alphabetical order in the result set? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/DB-Connect-How-to-prevent-append-command-from-sorting-columns-in/m-p/114781#M97638</link>
    <description>&lt;P&gt;I have gotten around this before by using the table command, so in your example :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index= host= |rex= spath |table a,k,h|sort time|append[|dbquery DB "select X,Z,W,P from table_T where  Order By time_col"] | table a,k,h,X,Z,W,P
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 10 Nov 2014 15:43:35 GMT</pubDate>
    <dc:creator>russellliss</dc:creator>
    <dc:date>2014-11-10T15:43:35Z</dc:date>
    <item>
      <title>DB Connect: How to prevent append command from sorting columns in alphabetical order in the result set?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/DB-Connect-How-to-prevent-append-command-from-sorting-columns-in/m-p/114780#M97637</link>
      <description>&lt;P&gt;I have a query that looks like the following:&lt;BR /&gt;
index=&amp;lt;&amp;gt; host=&amp;lt;&amp;gt; |rex=&amp;lt;&amp;gt; spath &amp;lt;&amp;gt;|table a,k,h|sort time|append[|dbquery DB "select X,Z,W,P from table_T where &amp;lt;&amp;gt; Order By time_col"]&lt;/P&gt;

&lt;P&gt;the result set has the following columns:&lt;BR /&gt;
a|k|h|P|W|X|Z&lt;BR /&gt;
While I expect &lt;BR /&gt;
a|k|h|X|Z|W|P&lt;/P&gt;

&lt;P&gt;How can I get rid of this automatic alphabetical sorting? &lt;BR /&gt;
While I run the dbquery alone, it works fine and shows me the expected columns.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 18:08:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/DB-Connect-How-to-prevent-append-command-from-sorting-columns-in/m-p/114780#M97637</guid>
      <dc:creator>pramit46</dc:creator>
      <dc:date>2020-09-28T18:08:51Z</dc:date>
    </item>
    <item>
      <title>Re: DB Connect: How to prevent append command from sorting columns in alphabetical order in the result set?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/DB-Connect-How-to-prevent-append-command-from-sorting-columns-in/m-p/114781#M97638</link>
      <description>&lt;P&gt;I have gotten around this before by using the table command, so in your example :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index= host= |rex= spath |table a,k,h|sort time|append[|dbquery DB "select X,Z,W,P from table_T where  Order By time_col"] | table a,k,h,X,Z,W,P
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 10 Nov 2014 15:43:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/DB-Connect-How-to-prevent-append-command-from-sorting-columns-in/m-p/114781#M97638</guid>
      <dc:creator>russellliss</dc:creator>
      <dc:date>2014-11-10T15:43:35Z</dc:date>
    </item>
    <item>
      <title>Re: DB Connect: How to prevent append command from sorting columns in alphabetical order in the result set?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/DB-Connect-How-to-prevent-append-command-from-sorting-columns-in/m-p/114782#M97639</link>
      <description>&lt;P&gt;Thanks a lot @russellliss. This was really helpful&lt;/P&gt;</description>
      <pubDate>Tue, 11 Nov 2014 11:06:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/DB-Connect-How-to-prevent-append-command-from-sorting-columns-in/m-p/114782#M97639</guid>
      <dc:creator>pramit46</dc:creator>
      <dc:date>2014-11-11T11:06:21Z</dc:date>
    </item>
  </channel>
</rss>

