<?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: Why would a command via CLI that exports to a CSV re-order the columns? Looks like the columns get re-ordered alphanumerically. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-would-a-command-via-CLI-that-exports-to-a-CSV-re-order-the/m-p/271661#M81784</link>
    <description>&lt;P&gt;i think, the table command changes the output file format. &lt;BR /&gt;
the -output csv (or table) does not affect the final file format. &lt;/P&gt;

&lt;P&gt;please try - &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;splunk@machine:~/bin&amp;gt; ./splunk search "index=os_nix sourcetype=vmstat earliest=-5m@m latest=now |head 10| table _time source host sourcetype mem_free" -maxout 20 -output table _time, sourcetype, host, source, mem_free &amp;gt; test2.csv
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;INFO: Your timerange was substituted based on your search string&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;splunk@machine:~/bin&amp;gt; ./splunk search "index=os_nix sourcetype=vmstat earliest=-5m@m latest=now |head 10| table source host _time sourcetype mem_free" -maxout 20 -output table _time, sourcetype, host, source, mem_free &amp;gt; test3.csv
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;INFO: Your timerange was substituted based on your search string&lt;/P&gt;</description>
    <pubDate>Fri, 23 Sep 2016 01:17:05 GMT</pubDate>
    <dc:creator>inventsekar</dc:creator>
    <dc:date>2016-09-23T01:17:05Z</dc:date>
    <item>
      <title>Why would a command via CLI that exports to a CSV re-order the columns? Looks like the columns get re-ordered alphanumerically.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-would-a-command-via-CLI-that-exports-to-a-CSV-re-order-the/m-p/271658#M81781</link>
      <description>&lt;P&gt;Splunk Web search ran:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=vmstat |head 10| table _time source sourcetype mem_free
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OUTPUT is as listed above in that order&lt;/P&gt;

&lt;P&gt;Splunk CLI command ran:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;root@&amp;lt;machine_name&amp;gt;:/opt/splunk/bin# ./splunk search "sourcetype=vmstat |head 10| table _time source sourcetype mem_free" -maxout 20 -output csv "_time", source, sourcetype, mem_free &amp;gt; test.csv
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The order that it shows in the output is alphabetical rather than in the order requested like the UI delivers.  Is this expected behavior? &lt;/P&gt;</description>
      <pubDate>Tue, 13 Oct 2015 21:34:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-would-a-command-via-CLI-that-exports-to-a-CSV-re-order-the/m-p/271658#M81781</guid>
      <dc:creator>kuja</dc:creator>
      <dc:date>2015-10-13T21:34:22Z</dc:date>
    </item>
    <item>
      <title>Re: Why would a command via CLI that exports to a CSV re-order the columns? Looks like the columns get re-ordered alphanumerically.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-would-a-command-via-CLI-that-exports-to-a-CSV-re-order-the/m-p/271659#M81782</link>
      <description>&lt;P&gt;I'm dealing with same issue. Does anyone has solved this nice behaviour? &lt;/P&gt;</description>
      <pubDate>Tue, 15 Mar 2016 02:36:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-would-a-command-via-CLI-that-exports-to-a-CSV-re-order-the/m-p/271659#M81782</guid>
      <dc:creator>carlostapia01</dc:creator>
      <dc:date>2016-03-15T02:36:07Z</dc:date>
    </item>
    <item>
      <title>Re: Why would a command via CLI that exports to a CSV re-order the columns? Looks like the columns get re-ordered alphanumerically.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-would-a-command-via-CLI-that-exports-to-a-CSV-re-order-the/m-p/271660#M81783</link>
      <description>&lt;P&gt;Mine isn't even alphabetical.  The column that should be first is actually last.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2016 23:55:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-would-a-command-via-CLI-that-exports-to-a-CSV-re-order-the/m-p/271660#M81783</guid>
      <dc:creator>gwiner</dc:creator>
      <dc:date>2016-09-22T23:55:22Z</dc:date>
    </item>
    <item>
      <title>Re: Why would a command via CLI that exports to a CSV re-order the columns? Looks like the columns get re-ordered alphanumerically.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-would-a-command-via-CLI-that-exports-to-a-CSV-re-order-the/m-p/271661#M81784</link>
      <description>&lt;P&gt;i think, the table command changes the output file format. &lt;BR /&gt;
the -output csv (or table) does not affect the final file format. &lt;/P&gt;

&lt;P&gt;please try - &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;splunk@machine:~/bin&amp;gt; ./splunk search "index=os_nix sourcetype=vmstat earliest=-5m@m latest=now |head 10| table _time source host sourcetype mem_free" -maxout 20 -output table _time, sourcetype, host, source, mem_free &amp;gt; test2.csv
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;INFO: Your timerange was substituted based on your search string&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;splunk@machine:~/bin&amp;gt; ./splunk search "index=os_nix sourcetype=vmstat earliest=-5m@m latest=now |head 10| table source host _time sourcetype mem_free" -maxout 20 -output table _time, sourcetype, host, source, mem_free &amp;gt; test3.csv
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;INFO: Your timerange was substituted based on your search string&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2016 01:17:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-would-a-command-via-CLI-that-exports-to-a-CSV-re-order-the/m-p/271661#M81784</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2016-09-23T01:17:05Z</dc:date>
    </item>
  </channel>
</rss>

