<?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 do I rename fields in my Splunk search result set? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-rename-fields-in-my-Splunk-search-result-set/m-p/282565#M85326</link>
    <description>&lt;P&gt;try like :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rename  FirstSourceType as  "Total Time Taken" , SecondSourceType as "Total time taken by zzz"  |...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;you can try like this in your case :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=xxx earliest=-7d@d latest=@d
( sourcetype="FirstSourceType" ResponsePayLoad="*xxx*" ActivityStep="rs" (ResponseStatus!=500 OR ResponseStatus!=400) )
OR
( sourcetype="SecondSourceType" OperationName=CSRequestProcessor.post ActivityStep="rs" ResponseStatus=0) 
| eval txn_id=if(transaction_id LIKE "[%]", substr(transaction_id, 2, 36) , transaction_id) | chart sum(Duration) over txn_id by sourcetype |replace  FirstSourceType with   "Total Time Taken" in sourcetype |replace  SecondSourceType with   "Total time taken by zzz" in sourcetype 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 27 Jan 2016 13:13:54 GMT</pubDate>
    <dc:creator>fdi01</dc:creator>
    <dc:date>2016-01-27T13:13:54Z</dc:date>
    <item>
      <title>How do I rename fields in my Splunk search result set?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-rename-fields-in-my-Splunk-search-result-set/m-p/282563#M85324</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;index=xxx earliest=-7d@d latest=@d
( sourcetype="FirstSourceType" ResponsePayLoad="*xxx*" ActivityStep="rs" (ResponseStatus!=500 OR ResponseStatus!=400) )
OR
( sourcetype="SecondSourceType" OperationName=CSRequestProcessor.post ActivityStep="rs" ResponseStatus=0)
| eval txn_id=if(transaction_id LIKE "[%]", substr(transaction_id, 2, 36) , transaction_id) | chart sum(Duration) over txn_id by sourcetype
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What I get is a table with three columns :&lt;/P&gt;

&lt;P&gt;txn_id ..... FirstSourceType ....  SecondSourceType&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Is it possible to rename FirstSourceType &amp;amp; SecondSourceType to "Total Time Taken" &amp;amp; "Total time taken by zzz" respectively?&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;I tried &lt;STRONG&gt;rename&lt;/STRONG&gt; command but couldn't get it to work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=xxx earliest=-7d@d latest=@d
( sourcetype="FirstSourceType" ResponsePayLoad="*xxx*" ActivityStep="rs" (ResponseStatus!=500 OR ResponseStatus!=400) ) | rename sourcetype to "Total Time Taken"
OR
( sourcetype="SecondSourceType" OperationName=CSRequestProcessor.post ActivityStep="rs" ResponseStatus=0)  | rename sourcetype to ""Total time taken by zzz"
| eval txn_id=if(transaction_id LIKE "[%]", substr(transaction_id, 2, 36) , transaction_id) | chart sum(Duration) over txn_id by sourcetype
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But I got the error: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Error in 'rename' command: Usage: rename [old_name AS/TO/-&amp;gt; new_name]+
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 19 Oct 2015 06:40:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-rename-fields-in-my-Splunk-search-result-set/m-p/282563#M85324</guid>
      <dc:creator>pawnalmighty</dc:creator>
      <dc:date>2015-10-19T06:40:00Z</dc:date>
    </item>
    <item>
      <title>Re: How do I rename fields in my Splunk search result set?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-rename-fields-in-my-Splunk-search-result-set/m-p/282564#M85325</link>
      <description>&lt;P&gt;you can try eval&lt;/P&gt;

&lt;P&gt;eval "Total Time Taken"=sourcetype&lt;/P&gt;

&lt;P&gt;and then you will need to get rid of the unwanted fields    | fields - sourcetype&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2015 09:35:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-rename-fields-in-my-Splunk-search-result-set/m-p/282564#M85325</guid>
      <dc:creator>asimagu</dc:creator>
      <dc:date>2015-10-19T09:35:22Z</dc:date>
    </item>
    <item>
      <title>Re: How do I rename fields in my Splunk search result set?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-rename-fields-in-my-Splunk-search-result-set/m-p/282565#M85326</link>
      <description>&lt;P&gt;try like :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rename  FirstSourceType as  "Total Time Taken" , SecondSourceType as "Total time taken by zzz"  |...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;you can try like this in your case :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=xxx earliest=-7d@d latest=@d
( sourcetype="FirstSourceType" ResponsePayLoad="*xxx*" ActivityStep="rs" (ResponseStatus!=500 OR ResponseStatus!=400) )
OR
( sourcetype="SecondSourceType" OperationName=CSRequestProcessor.post ActivityStep="rs" ResponseStatus=0) 
| eval txn_id=if(transaction_id LIKE "[%]", substr(transaction_id, 2, 36) , transaction_id) | chart sum(Duration) over txn_id by sourcetype |replace  FirstSourceType with   "Total Time Taken" in sourcetype |replace  SecondSourceType with   "Total time taken by zzz" in sourcetype 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 27 Jan 2016 13:13:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-rename-fields-in-my-Splunk-search-result-set/m-p/282565#M85326</guid>
      <dc:creator>fdi01</dc:creator>
      <dc:date>2016-01-27T13:13:54Z</dc:date>
    </item>
  </channel>
</rss>

