<?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: Renaming fields in a table without changing column order in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-rename-fields-in-a-table-without-changing-column-order/m-p/627398#M218018</link>
    <description>&lt;P&gt;Yup, that worked - I've always wondered about the performance of a transpose with a large dataset. I imagine under the hood it could be pretty efficient. Probably need to do some performance comparisons with it to see if it's a practical solution for big sets.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 17 Jan 2023 22:52:35 GMT</pubDate>
    <dc:creator>bowesmana</dc:creator>
    <dc:date>2023-01-17T22:52:35Z</dc:date>
    <item>
      <title>How to rename fields in a table without changing column order?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-rename-fields-in-a-table-without-changing-column-order/m-p/627309#M217987</link>
      <description>&lt;P&gt;Any suggestions on how to rename fields and keep those fields in their stated table order.&lt;/P&gt;
&lt;P&gt;I have a bunch of fields that are attributes that are named is_XXX. I want all those fields to be on the right hand side of the table, so if I do&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;&amp;lt;search&amp;gt;
| foreach is_* [ eval "zz_&amp;lt;&amp;lt;MATCHSTR&amp;gt;&amp;gt;"=if(&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;=1,"","")]
| fields - is_* 
| table entity entity_type *&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;it works nicely and puts the first two named fields as the first two columns, then other fields then all the zz_* fields.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="bowesmana_1-1673939567509.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/23398i63AAC6E18FEAAD9C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="bowesmana_1-1673939567509.png" alt="bowesmana_1-1673939567509.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, as soon as I add&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| rename zz_* as *&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;it changes the order and sorts all the columns (apart from the first named two) into alphabetical order.&lt;/P&gt;
&lt;P&gt;Any specifically named fields I add after entity_type persist the column order but all fields output as a result of the wildcard lose their order after the rename.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="bowesmana_2-1673939659718.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/23399i7970881F610B09AE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="bowesmana_2-1673939659718.png" alt="bowesmana_2-1673939659718.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2023 20:26:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-rename-fields-in-a-table-without-changing-column-order/m-p/627309#M217987</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-01-17T20:26:32Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming fields in a table without changing column order</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-rename-fields-in-a-table-without-changing-column-order/m-p/627316#M217988</link>
      <description>&lt;P&gt;transpose, alter the values in the field names column, transpose back again&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2023 09:09:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-rename-fields-in-a-table-without-changing-column-order/m-p/627316#M217988</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-01-17T09:09:27Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming fields in a table without changing column order</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-rename-fields-in-a-table-without-changing-column-order/m-p/627398#M218018</link>
      <description>&lt;P&gt;Yup, that worked - I've always wondered about the performance of a transpose with a large dataset. I imagine under the hood it could be pretty efficient. Probably need to do some performance comparisons with it to see if it's a practical solution for big sets.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2023 22:52:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-rename-fields-in-a-table-without-changing-column-order/m-p/627398#M218018</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-01-17T22:52:35Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming fields in a table without changing column order</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-rename-fields-in-a-table-without-changing-column-order/m-p/627399#M218019</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FYI:&amp;nbsp;transpose 0 with large row count won't work&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults count=100
| eval x=1
| eval r=mvrange(1,10000,1)
| mvexpand r
| table r x
| transpose 0 column_name=header&lt;/LI-CODE&gt;&lt;P&gt;without the transpose it creates the million rows quickly, but the transpose just dies - been running for a while now...&lt;/P&gt;&lt;P&gt;Anyway, the solution works for my use case.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2023 22:58:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-rename-fields-in-a-table-without-changing-column-order/m-p/627399#M218019</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-01-17T22:58:25Z</dc:date>
    </item>
  </channel>
</rss>

