<?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 can I re-order my table with the join command? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/how-can-I-re-order-my-table-with-the-join-command/m-p/143538#M39884</link>
    <description>&lt;P&gt;Note: unless one or both sourcetypes is very sparsely occurring in time,  it's probably faster to use this search instead. &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;host="ws1" ( sourcetype=ejsysinfo_sort OR sourcetype=ejlog_sort ) | head 1000 | stats first(HD) as "Total Disk GB" last(Available_D) as "Available Disk GB" by host Model | table host "Total Disk GB" "Available Disk GB" Model&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;It may feel like the join version is faster because it only gets 2 events off disk, but in reality splunk is probably getting quite a lot off disk for a split second and then truncating each search to 1 row. And the join version runs two searches so you get twice the search-dispatch overhead. &lt;/P&gt;</description>
    <pubDate>Tue, 14 Apr 2015 15:47:53 GMT</pubDate>
    <dc:creator>sideview</dc:creator>
    <dc:date>2015-04-14T15:47:53Z</dc:date>
    <item>
      <title>how can I re-order my table with the join command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-can-I-re-order-my-table-with-the-join-command/m-p/143530#M39876</link>
      <description>&lt;P&gt;I have a search using the join command and it works well, but I'm not sure how to re-order my table.  My search is &lt;BR /&gt;
sourcetype=ejsysinfo_sort host="ws1"| head 1 | rename HD as "Total Disk GB" |table host,"Total Disk GB",Model |join  [ search sourcetype=ejlog_sort host="ws1"| head 1  | rename Available_D as "Available Disk GB"| table "Available Disk GB"] &lt;BR /&gt;
So I have a table that shows host,"Total Disk GB",Model,"Available Disk GB".  How can I switch the table order to show host,"Total Disk GB","Available Disk GB",Model?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:31:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-can-I-re-order-my-table-with-the-join-command/m-p/143530#M39876</guid>
      <dc:creator>chadman</dc:creator>
      <dc:date>2020-09-28T19:31:46Z</dc:date>
    </item>
    <item>
      <title>Re: how can I re-order my table with the join command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-can-I-re-order-my-table-with-the-join-command/m-p/143531#M39877</link>
      <description>&lt;P&gt;You can reorder a table with the &lt;CODE&gt;table&lt;/CODE&gt; command by listing the columns in the order you want.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Apr 2015 12:58:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-can-I-re-order-my-table-with-the-join-command/m-p/143531#M39877</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2015-04-14T12:58:53Z</dc:date>
    </item>
    <item>
      <title>Re: how can I re-order my table with the join command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-can-I-re-order-my-table-with-the-join-command/m-p/143532#M39878</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=ejsysinfo_sort host="ws1"| head 1 | rename HD as "Total Disk GB" |table host,"Total Disk GB",Model |join [ search sourcetype=ejlog_sort host="ws1"| head 1 | rename Available_D as "Available Disk GB"| table "Available Disk GB"] |table host,"Total Disk GB","Available Disk GB", Model
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I just add this code at the end of your query:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...|table host,"Total Disk GB","Available Disk GB", Model
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 14 Apr 2015 13:01:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-can-I-re-order-my-table-with-the-join-command/m-p/143532#M39878</guid>
      <dc:creator>NOUMSSI</dc:creator>
      <dc:date>2015-04-14T13:01:33Z</dc:date>
    </item>
    <item>
      <title>Re: how can I re-order my table with the join command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-can-I-re-order-my-table-with-the-join-command/m-p/143533#M39879</link>
      <description>&lt;P&gt;Hi chadman,&lt;/P&gt;

&lt;P&gt;Try with this:&lt;/P&gt;

&lt;P&gt;sourcetype=ejsysinfo_sort host="ws1"| head 1 | rename HD as "Total Disk GB" |table host,"Total Disk GB",Model |join [ search sourcetype=ejlog_sort host="ws1"| head 1 | rename Available_D as "Available Disk GB"] |table host,"Total Disk GB","Available Disk GB",Model&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:28:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-can-I-re-order-my-table-with-the-join-command/m-p/143533#M39879</guid>
      <dc:creator>ngatchasandra</dc:creator>
      <dc:date>2020-09-28T19:28:19Z</dc:date>
    </item>
    <item>
      <title>Re: how can I re-order my table with the join command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-can-I-re-order-my-table-with-the-join-command/m-p/143534#M39880</link>
      <description>&lt;P&gt;I'm using the table command in my seach, but not sure how to make it work with my subsearch with join.  It displays the data I want in the table, but in the wrong order.  In my example I could only get this to work by using the table command twice in my search.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Apr 2015 13:09:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-can-I-re-order-my-table-with-the-join-command/m-p/143534#M39880</guid>
      <dc:creator>chadman</dc:creator>
      <dc:date>2015-04-14T13:09:08Z</dc:date>
    </item>
    <item>
      <title>Re: how can I re-order my table with the join command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-can-I-re-order-my-table-with-the-join-command/m-p/143535#M39881</link>
      <description>&lt;P&gt;Thanks that worked!&lt;/P&gt;</description>
      <pubDate>Tue, 14 Apr 2015 13:15:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-can-I-re-order-my-table-with-the-join-command/m-p/143535#M39881</guid>
      <dc:creator>chadman</dc:creator>
      <dc:date>2015-04-14T13:15:09Z</dc:date>
    </item>
    <item>
      <title>Re: how can I re-order my table with the join command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-can-I-re-order-my-table-with-the-join-command/m-p/143536#M39882</link>
      <description>&lt;P&gt;Thanks, that also worked:-)&lt;/P&gt;</description>
      <pubDate>Tue, 14 Apr 2015 13:15:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-can-I-re-order-my-table-with-the-join-command/m-p/143536#M39882</guid>
      <dc:creator>chadman</dc:creator>
      <dc:date>2015-04-14T13:15:35Z</dc:date>
    </item>
    <item>
      <title>Re: how can I re-order my table with the join command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-can-I-re-order-my-table-with-the-join-command/m-p/143537#M39883</link>
      <description>&lt;P&gt;The table command oder automatically the tables in order which you specify! Try with this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=ejsysinfo_sort host="ws1"| head 1 | rename HD as "Total Disk GB" |join [ search sourcetype=ejlog_sort host="ws1"| head 1 | rename Available_D as "Available Disk GB"] |table host,"Total Disk GB","Available Disk GB",Model
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 14 Apr 2015 13:16:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-can-I-re-order-my-table-with-the-join-command/m-p/143537#M39883</guid>
      <dc:creator>ngatchasandra</dc:creator>
      <dc:date>2015-04-14T13:16:28Z</dc:date>
    </item>
    <item>
      <title>Re: how can I re-order my table with the join command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-can-I-re-order-my-table-with-the-join-command/m-p/143538#M39884</link>
      <description>&lt;P&gt;Note: unless one or both sourcetypes is very sparsely occurring in time,  it's probably faster to use this search instead. &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;host="ws1" ( sourcetype=ejsysinfo_sort OR sourcetype=ejlog_sort ) | head 1000 | stats first(HD) as "Total Disk GB" last(Available_D) as "Available Disk GB" by host Model | table host "Total Disk GB" "Available Disk GB" Model&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;It may feel like the join version is faster because it only gets 2 events off disk, but in reality splunk is probably getting quite a lot off disk for a split second and then truncating each search to 1 row. And the join version runs two searches so you get twice the search-dispatch overhead. &lt;/P&gt;</description>
      <pubDate>Tue, 14 Apr 2015 15:47:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-can-I-re-order-my-table-with-the-join-command/m-p/143538#M39884</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2015-04-14T15:47:53Z</dc:date>
    </item>
    <item>
      <title>Re: how can I re-order my table with the join command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-can-I-re-order-my-table-with-the-join-command/m-p/143539#M39885</link>
      <description>&lt;P&gt;Sideview, I tried your search and it seems to work ok, but looks like it's looking at 28000 events instead of 2.  It also takes a little longer.  So I have one sourcetype that is rarely updated and another that gets updates every min and in this case is about 28000 events.  So I was thinking that the "head" command would help speed that up by only grabing the most recent event in the search.  I'm still new to all this and trying to get the best searches created for my users.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Apr 2015 17:12:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-can-I-re-order-my-table-with-the-join-command/m-p/143539#M39885</guid>
      <dc:creator>chadman</dc:creator>
      <dc:date>2015-04-14T17:12:29Z</dc:date>
    </item>
    <item>
      <title>Re: how can I re-order my table with the join command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-can-I-re-order-my-table-with-the-join-command/m-p/143540#M39886</link>
      <description>&lt;P&gt;If one sourcetype is rarely updated you may want to consider moving that to a lookup instead of (on top of) indexing it.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Apr 2015 17:22:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-can-I-re-order-my-table-with-the-join-command/m-p/143540#M39886</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2015-04-14T17:22:31Z</dc:date>
    </item>
  </channel>
</rss>

