<?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 splunk column names in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-rename-Splunk-column-names/m-p/126966#M34406</link>
    <description>&lt;P&gt;I really appreciate you sharing this example. It is bit confusing that it doesn't work for me when I have the value of var1 being calculated just after my query. When I moved this calculation just before the &lt;EM&gt;eval Number {var1} is good = column_name | fields - column_name&lt;/EM&gt;, it worked for me.&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 18:12:58 GMT</pubDate>
    <dc:creator>nibinabr</dc:creator>
    <dc:date>2020-09-28T18:12:58Z</dc:date>
    <item>
      <title>How to rename Splunk column names?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-rename-Splunk-column-names/m-p/126962#M34402</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have a query that evaluates the value of a variable like this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;*...|eval var1= var2*10|....*
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;where var1 and var2 are variables.&lt;/P&gt;
&lt;P&gt;Now I need to rename the column header by doing something like this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;*rename column_name as "Number ".var1." is good"* .
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But the output I see is &lt;CODE&gt;*"Number ".var1." is good"*&lt;/CODE&gt; and var1 is not getting replaced by the value. What is the right way of doing this ?&lt;/P&gt;
&lt;P&gt;Any help will be appreciated.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2023 20:52:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-rename-Splunk-column-names/m-p/126962#M34402</guid>
      <dc:creator>nibinabr</dc:creator>
      <dc:date>2023-02-10T20:52:19Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming splunk column names</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-rename-Splunk-column-names/m-p/126963#M34403</link>
      <description>&lt;P&gt;&lt;CODE&gt;rename&lt;/CODE&gt; can't access column values. Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval Number {var1} is good = column_name | fields - column_name
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 18 Nov 2014 20:43:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-rename-Splunk-column-names/m-p/126963#M34403</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-11-18T20:43:05Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming splunk column names</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-rename-Splunk-column-names/m-p/126964#M34404</link>
      <description>&lt;P&gt;Thanks @martin_muller for the quick reply. I tried your solution and now the column in the output now changed to "Number is good". It is not printing the value of var1 between "Number" and "is". &lt;/P&gt;</description>
      <pubDate>Tue, 18 Nov 2014 21:33:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-rename-Splunk-column-names/m-p/126964#M34404</guid>
      <dc:creator>nibinabr</dc:creator>
      <dc:date>2014-11-18T21:33:18Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming splunk column names</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-rename-Splunk-column-names/m-p/126965#M34405</link>
      <description>&lt;P&gt;Try running this dummy example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats count | eval var1="42 43 44" | makemv var1 | mvexpand var1 | eval column_name = "foo" | eval Number {var1} is good = column_name | fields - column_name
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/158i03929A7A50ADFE19/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Nov 2014 21:51:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-rename-Splunk-column-names/m-p/126965#M34405</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-11-18T21:51:00Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming splunk column names</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-rename-Splunk-column-names/m-p/126966#M34406</link>
      <description>&lt;P&gt;I really appreciate you sharing this example. It is bit confusing that it doesn't work for me when I have the value of var1 being calculated just after my query. When I moved this calculation just before the &lt;EM&gt;eval Number {var1} is good = column_name | fields - column_name&lt;/EM&gt;, it worked for me.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 18:12:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-rename-Splunk-column-names/m-p/126966#M34406</guid>
      <dc:creator>nibinabr</dc:creator>
      <dc:date>2020-09-28T18:12:58Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming splunk column names</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-rename-Splunk-column-names/m-p/126967#M34407</link>
      <description>&lt;P&gt;Well, it can't use values from the future...&lt;/P&gt;</description>
      <pubDate>Tue, 18 Nov 2014 22:24:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-rename-Splunk-column-names/m-p/126967#M34407</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-11-18T22:24:33Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming splunk column names</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-rename-Splunk-column-names/m-p/126968#M34408</link>
      <description>&lt;P&gt;I mean&lt;BR /&gt;
&lt;EM&gt;stats.....|eval var1=var2*10|....|....|......|....|eval Number {var1} is good = column_name | fields - column_name&lt;/EM&gt;&lt;BR /&gt;
didnot work for me.&lt;/P&gt;

&lt;P&gt;It worked when I changed the above to &lt;BR /&gt;
&lt;EM&gt;stats.....|....|....|......|....|eval var1=var2*10|eval Number {var1} is good = column_name | fields - column_name&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 18:12:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-rename-Splunk-column-names/m-p/126968#M34408</guid>
      <dc:creator>nibinabr</dc:creator>
      <dc:date>2020-09-28T18:12:07Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming splunk column names</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-rename-Splunk-column-names/m-p/630390#M219006</link>
      <description>&lt;P&gt;what if variable is holding the column_name and then I want to sort that column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;for example&lt;/P&gt;&lt;P&gt;&lt;EM&gt;my_search | eval date="2023-02-02" | &lt;STRONG&gt;sort&amp;nbsp; - $date&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;is it possible to sort by column name which is dynamically generated So i won't know the exact name But variable holds the column name So I can just use &lt;STRONG&gt;sort - $Variable?&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2023 05:05:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-rename-Splunk-column-names/m-p/630390#M219006</guid>
      <dc:creator>sukansingh</dc:creator>
      <dc:date>2023-02-10T05:05:30Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming splunk column names</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-rename-Splunk-column-names/m-p/630395#M219010</link>
      <description>&lt;P&gt;Please post this as a new question rather than asking a different variant of another question on an 8 year old answer question. It will get more attention.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2023 05:23:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-rename-Splunk-column-names/m-p/630395#M219010</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-02-10T05:23:36Z</dc:date>
    </item>
  </channel>
</rss>

