<?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 How to rotate a table using transpose, remove the first row, and rename the column headers? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-rotate-a-table-using-transpose-remove-the-first-row-and/m-p/135301#M36995</link>
    <description>&lt;P&gt;i have this search which gives me: &lt;BR /&gt;
&lt;CODE&gt;... | stats max(field1) as foo max(field2) as bar max(field3) as la by subname2&lt;/CODE&gt;&lt;BR /&gt;
which gives me this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;subname2    foo     bar     la
SG  300000  160000  100000
US  300000  160000  60000 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If i use transpose with this &lt;BR /&gt;
&lt;CODE&gt;... | stats max(field1) as foo max(field2) as bar max(field3) as la by subname2 | transpose&lt;/CODE&gt;&lt;BR /&gt;
I get &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;column  row 1   row 2
subname2    SG  US
foo     300000  300000
bar     160000  160000
la  100000  60000 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now how do I remove the the 1st row of the table "subname2  SG  US" and use this as my column headers? &lt;/P&gt;

&lt;P&gt;I know I can do this:&lt;BR /&gt;
&lt;CODE&gt;...| rename column as subname2 | rename "row 1" as SG | rename "row 2" as US&lt;/CODE&gt;&lt;BR /&gt;
to rename the column headers.&lt;/P&gt;

&lt;P&gt;But how do I remove the first row? And is this the best way of doing this? &lt;/P&gt;

&lt;P&gt;Ultimately I want this: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;subname2    SG  US
foo     300000  300000
bar     160000  160000
la  100000  60000 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;NOTE: A smilar question has been asked &lt;A href="http://answers.splunk.com/answers/98552/turning-a-table-transpose.html#answer-241077"&gt;here&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 04 Jun 2015 02:44:35 GMT</pubDate>
    <dc:creator>HattrickNZ</dc:creator>
    <dc:date>2015-06-04T02:44:35Z</dc:date>
    <item>
      <title>How to rotate a table using transpose, remove the first row, and rename the column headers?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-rotate-a-table-using-transpose-remove-the-first-row-and/m-p/135301#M36995</link>
      <description>&lt;P&gt;i have this search which gives me: &lt;BR /&gt;
&lt;CODE&gt;... | stats max(field1) as foo max(field2) as bar max(field3) as la by subname2&lt;/CODE&gt;&lt;BR /&gt;
which gives me this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;subname2    foo     bar     la
SG  300000  160000  100000
US  300000  160000  60000 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If i use transpose with this &lt;BR /&gt;
&lt;CODE&gt;... | stats max(field1) as foo max(field2) as bar max(field3) as la by subname2 | transpose&lt;/CODE&gt;&lt;BR /&gt;
I get &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;column  row 1   row 2
subname2    SG  US
foo     300000  300000
bar     160000  160000
la  100000  60000 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now how do I remove the the 1st row of the table "subname2  SG  US" and use this as my column headers? &lt;/P&gt;

&lt;P&gt;I know I can do this:&lt;BR /&gt;
&lt;CODE&gt;...| rename column as subname2 | rename "row 1" as SG | rename "row 2" as US&lt;/CODE&gt;&lt;BR /&gt;
to rename the column headers.&lt;/P&gt;

&lt;P&gt;But how do I remove the first row? And is this the best way of doing this? &lt;/P&gt;

&lt;P&gt;Ultimately I want this: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;subname2    SG  US
foo     300000  300000
bar     160000  160000
la  100000  60000 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;NOTE: A smilar question has been asked &lt;A href="http://answers.splunk.com/answers/98552/turning-a-table-transpose.html#answer-241077"&gt;here&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jun 2015 02:44:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-rotate-a-table-using-transpose-remove-the-first-row-and/m-p/135301#M36995</guid>
      <dc:creator>HattrickNZ</dc:creator>
      <dc:date>2015-06-04T02:44:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to rotate a table using transpose, remove the first row, and rename the column headers?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-rotate-a-table-using-transpose-remove-the-first-row-and/m-p/135302#M36996</link>
      <description>&lt;P&gt;Is using &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.3/SearchReference/transpose"&gt;transpose&lt;/A&gt; a requirement? What about using a combination of &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.3/SearchReference/untable"&gt;untable&lt;/A&gt; and &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.3/SearchReference/xyseries"&gt;xyseries&lt;/A&gt;?&lt;/P&gt;

&lt;P&gt;Such as:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | stats max(field1) as foo max(field2) as bar max(field3) as la by subname2 | untable subname2 field value | xyseries field subname2 value | rename field as subname2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Edit: actually one tweak to change the first column name back &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jun 2015 03:14:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-rotate-a-table-using-transpose-remove-the-first-row-and/m-p/135302#M36996</guid>
      <dc:creator>acharlieh</dc:creator>
      <dc:date>2015-06-04T03:14:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to rotate a table using transpose, remove the first row, and rename the column headers?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-rotate-a-table-using-transpose-remove-the-first-row-and/m-p/135303#M36997</link>
      <description>&lt;P&gt;tks, I think this is exactly what I am looking for. &lt;/P&gt;

&lt;P&gt;transpose was the only way I could think of at the time.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jun 2015 03:32:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-rotate-a-table-using-transpose-remove-the-first-row-and/m-p/135303#M36997</guid>
      <dc:creator>HattrickNZ</dc:creator>
      <dc:date>2015-06-04T03:32:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to rotate a table using transpose, remove the first row, and rename the column headers?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-rotate-a-table-using-transpose-remove-the-first-row-and/m-p/135304#M36998</link>
      <description>&lt;P&gt;&lt;CODE&gt;transpose&lt;/CODE&gt; should have an optional parameter &lt;CODE&gt;over&lt;/CODE&gt; which just does &lt;CODE&gt;| untable &amp;lt;over&amp;gt; a b | xyseries a &amp;lt;over&amp;gt; b&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Feb 2017 17:11:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-rotate-a-table-using-transpose-remove-the-first-row-and/m-p/135304#M36998</guid>
      <dc:creator>bhawkins1</dc:creator>
      <dc:date>2017-02-07T17:11:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to rotate a table using transpose, remove the first row, and rename the column headers?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-rotate-a-table-using-transpose-remove-the-first-row-and/m-p/135305#M36999</link>
      <description>&lt;P&gt;Hi , Please try the below and let me know the result&lt;BR /&gt;
| stats max(field1) as foo max(field2) as bar max(field3) as la by subname2 &lt;BR /&gt;
| transpose  header_field=column&lt;BR /&gt;
| fields- column&lt;/P&gt;</description>
      <pubDate>Thu, 09 Aug 2018 13:23:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-rotate-a-table-using-transpose-remove-the-first-row-and/m-p/135305#M36999</guid>
      <dc:creator>ksubramanian198</dc:creator>
      <dc:date>2018-08-09T13:23:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to rotate a table using transpose, remove the first row, and rename the column headers?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-rotate-a-table-using-transpose-remove-the-first-row-and/m-p/135306#M37000</link>
      <description>&lt;P&gt;I think this is easier.&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;PRE&gt;&lt;CODE&gt;... 
 | transpose header_field=subname2
 | rename column as subname2
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Sat, 08 Sep 2018 14:59:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-rotate-a-table-using-transpose-remove-the-first-row-and/m-p/135306#M37000</guid>
      <dc:creator>tmurata_splunk</dc:creator>
      <dc:date>2018-09-08T14:59:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to rotate a table using transpose, remove the first row, and rename the column headers?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-rotate-a-table-using-transpose-remove-the-first-row-and/m-p/135307#M37001</link>
      <description>&lt;P&gt;Right this one easier and quickly too...!! thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Apr 2019 14:57:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-rotate-a-table-using-transpose-remove-the-first-row-and/m-p/135307#M37001</guid>
      <dc:creator>dhirendra761</dc:creator>
      <dc:date>2019-04-10T14:57:46Z</dc:date>
    </item>
  </channel>
</rss>

