<?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 results doesn't work in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Rename-results-doesn-t-work/m-p/64323#M15913</link>
    <description>&lt;P&gt;You can use eval case(), but you would need to list each one in the case statement, and you can’t use wildcards directly.  It would look something like this:&lt;/P&gt;

&lt;P&gt;sourcetype="ContributionWebApi"  DbQuery=* | eval  DbQuery_desc=case(DbQuery=“EXEC [usp_GetClientListHierarchyNode]”,"EXEC GetClientListHierarchy",DbQuery=” EXEC [usp_GetClientListHierarchyTopLevel]”,“EXEC  usp_GetClientListHierarchyTopLevel”,DbQuery=”EXEC [zambezi.usp_GetDealsByClient]”,DbQuery=“EXEC [zambezi.usp_GetDealsByClient]”,”EXEC zambezi.usp_GetDealsByClient”,DbQuery=”SELECT DISTINCT(UserTeamId) FROM SmartWarehouse.dbo.SR_UserTeam”,”SELECT DISTINCT  UserTeamId  FROM SmartWarehouse.dbo.SR_UserTeam”) |  chart count by DbQuery_desc&lt;/P&gt;

&lt;P&gt;You may also be able to use a lookup.  You would still need to list all of the possible results with your desired wording, but they would be in a csv file not in the search.&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 14:47:07 GMT</pubDate>
    <dc:creator>lukejadamec</dc:creator>
    <dc:date>2020-09-28T14:47:07Z</dc:date>
    <item>
      <title>Rename results doesn't work</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rename-results-doesn-t-work/m-p/64322#M15912</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;I have a feeling I'm missing something simple here. This is my search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="ContributionWebApi"  DbQuery=* | chart count by DbQuery 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And this are my results:    &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;DbQuery--------------------------------------------------------------------count

EXEC [usp_GetClientListHierarchyNode] --------------------------------------3

EXEC [usp_GetClientListHierarchyTopLevel]-----------------------------------68

EXEC [zambezi.usp_GetDealsByClient]-----------------------------------------77

SELECT DISTINCT(UserTeamId) FROM SmartWarehouse.dbo.SR_UserTeam-------------68
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to rename the DbQuery results to something more meaningful. I.e. for the first row, I'd rather it says "EXEC GetClientListHierarchy"&lt;/P&gt;

&lt;P&gt;Is it possible to do this in the initial search? (i.e. using "rename"?) If not, where and how can I do this.&lt;/P&gt;

&lt;P&gt;Thanks a lot&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2013 15:33:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rename-results-doesn-t-work/m-p/64322#M15912</guid>
      <dc:creator>philallen1</dc:creator>
      <dc:date>2013-09-16T15:33:31Z</dc:date>
    </item>
    <item>
      <title>Re: Rename results doesn't work</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rename-results-doesn-t-work/m-p/64323#M15913</link>
      <description>&lt;P&gt;You can use eval case(), but you would need to list each one in the case statement, and you can’t use wildcards directly.  It would look something like this:&lt;/P&gt;

&lt;P&gt;sourcetype="ContributionWebApi"  DbQuery=* | eval  DbQuery_desc=case(DbQuery=“EXEC [usp_GetClientListHierarchyNode]”,"EXEC GetClientListHierarchy",DbQuery=” EXEC [usp_GetClientListHierarchyTopLevel]”,“EXEC  usp_GetClientListHierarchyTopLevel”,DbQuery=”EXEC [zambezi.usp_GetDealsByClient]”,DbQuery=“EXEC [zambezi.usp_GetDealsByClient]”,”EXEC zambezi.usp_GetDealsByClient”,DbQuery=”SELECT DISTINCT(UserTeamId) FROM SmartWarehouse.dbo.SR_UserTeam”,”SELECT DISTINCT  UserTeamId  FROM SmartWarehouse.dbo.SR_UserTeam”) |  chart count by DbQuery_desc&lt;/P&gt;

&lt;P&gt;You may also be able to use a lookup.  You would still need to list all of the possible results with your desired wording, but they would be in a csv file not in the search.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:47:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rename-results-doesn-t-work/m-p/64323#M15913</guid>
      <dc:creator>lukejadamec</dc:creator>
      <dc:date>2020-09-28T14:47:07Z</dc:date>
    </item>
    <item>
      <title>Re: Rename results doesn't work</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rename-results-doesn-t-work/m-p/64324#M15914</link>
      <description>&lt;P&gt;Rename is for field names and you want to update field values, so that is not applicable for your case. You can use eval-replace if you know what are the possible strings you want to remove. Your example (changing "EXEC [usp_GetClientListHierarchyNode]" to "EXEC GetClientListHierarchy") can be achieve by following:-&lt;/P&gt;

&lt;P&gt;sourcetype="ContributionWebApi"  DbQuery=* | eval DbQuery=replace(DbQuery,"\[","") | eval DbQuery=replace(DbQuery,"\]","")| chart count by DbQuery&lt;/P&gt;

&lt;P&gt;forward slash is escape character for brackets.&lt;/P&gt;

&lt;P&gt;you can add more eval-replace part for all your customizations.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2013 14:43:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rename-results-doesn-t-work/m-p/64324#M15914</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2013-09-17T14:43:03Z</dc:date>
    </item>
  </channel>
</rss>

