<?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: rename the name of a field with the value of another field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/rename-the-name-of-a-field-with-the-value-of-another-field/m-p/458043#M168119</link>
    <description>&lt;P&gt;@marziaolla,&lt;/P&gt;

&lt;P&gt;Try this &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults |eval abc="123",xyz="567"|eval tmp="abc".xyz|eval {tmp}="To be replaced by value of field"|fields - tmp
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 26 Jul 2018 16:21:09 GMT</pubDate>
    <dc:creator>renjith_nair</dc:creator>
    <dc:date>2018-07-26T16:21:09Z</dc:date>
    <item>
      <title>rename the name of a field with the value of another field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rename-the-name-of-a-field-with-the-value-of-another-field/m-p/458042#M168118</link>
      <description>&lt;P&gt;Hello there, &lt;/P&gt;

&lt;P&gt;After a stats command, I would like to rename the name of a field using a string and the value of another field&lt;BR /&gt;
eg. fieldname i'd like -&amp;gt; "ABC 2018" but 2018 is stored in a field&lt;/P&gt;

&lt;P&gt;I've tried with eval {ABC}="ABC".year but it doesn't work.&lt;/P&gt;

&lt;P&gt;can someone help me?&lt;BR /&gt;
TNX &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jul 2018 16:07:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rename-the-name-of-a-field-with-the-value-of-another-field/m-p/458042#M168118</guid>
      <dc:creator>marziaolla</dc:creator>
      <dc:date>2018-07-26T16:07:07Z</dc:date>
    </item>
    <item>
      <title>Re: rename the name of a field with the value of another field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rename-the-name-of-a-field-with-the-value-of-another-field/m-p/458043#M168119</link>
      <description>&lt;P&gt;@marziaolla,&lt;/P&gt;

&lt;P&gt;Try this &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults |eval abc="123",xyz="567"|eval tmp="abc".xyz|eval {tmp}="To be replaced by value of field"|fields - tmp
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 26 Jul 2018 16:21:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rename-the-name-of-a-field-with-the-value-of-another-field/m-p/458043#M168119</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-07-26T16:21:09Z</dc:date>
    </item>
    <item>
      <title>Re: rename the name of a field with the value of another field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rename-the-name-of-a-field-with-the-value-of-another-field/m-p/458044#M168120</link>
      <description>&lt;P&gt;@marziaolla, did it work for you ?&lt;/P&gt;</description>
      <pubDate>Sun, 29 Jul 2018 01:07:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rename-the-name-of-a-field-with-the-value-of-another-field/m-p/458044#M168120</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-07-29T01:07:41Z</dc:date>
    </item>
    <item>
      <title>Re: rename the name of a field with the value of another field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rename-the-name-of-a-field-with-the-value-of-another-field/m-p/458045#M168121</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults
| eval XYZ="123"
| eval year="2018"
| rename StuffBelowIsTheSame AS "rename XYZ AS ABC2018"
| eval newname="ABC" . year
| eval {newname}=XYZ
| fields - newname XYZ
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 29 Jul 2018 02:05:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rename-the-name-of-a-field-with-the-value-of-another-field/m-p/458045#M168121</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2018-07-29T02:05:45Z</dc:date>
    </item>
  </channel>
</rss>

