<?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 Renaming column names(field value) in a search result in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Renaming-column-names-field-value-in-a-search-result/m-p/202904#M58913</link>
    <description>&lt;P&gt;We have a test index which captures all the response times of different transactions by version&lt;/P&gt;

&lt;P&gt;I wrote a search to display different response times by different transactions and version&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=testing test_type=CI  test_function="ok.pct90" | chart avg(transaction_RT_val) AS "90%_RT" by transaction, version
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to write to show the difference in response time between every ve&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/1053i5A4AAE1728501ACA/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;rsion (Version numbers keep on changing every time)&lt;/P&gt;

&lt;P&gt;Maybe some thing like this but the problem with this one is the version number always change&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=testing test_type=CI  test_function="ok.pct90" | chart avg(transaction_RT_val) AS "90%_RT" by transaction,version | rename "99864.0.0" as Test1, "99867.0.0" as Test2 , "99868.0.0" as Test3 | eval Change1 = ((Test2-Test1)/Test2*100) | eval  Change2 = ((Test3-Test2)/Test3*100) | fields transaction, Change1, Change2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Preferably I want to filter the results to show a maximum of last 5 versions&lt;/P&gt;</description>
    <pubDate>Fri, 12 Feb 2016 15:46:47 GMT</pubDate>
    <dc:creator>nitin_gurram</dc:creator>
    <dc:date>2016-02-12T15:46:47Z</dc:date>
    <item>
      <title>Renaming column names(field value) in a search result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Renaming-column-names-field-value-in-a-search-result/m-p/202904#M58913</link>
      <description>&lt;P&gt;We have a test index which captures all the response times of different transactions by version&lt;/P&gt;

&lt;P&gt;I wrote a search to display different response times by different transactions and version&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=testing test_type=CI  test_function="ok.pct90" | chart avg(transaction_RT_val) AS "90%_RT" by transaction, version
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to write to show the difference in response time between every ve&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/1053i5A4AAE1728501ACA/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;rsion (Version numbers keep on changing every time)&lt;/P&gt;

&lt;P&gt;Maybe some thing like this but the problem with this one is the version number always change&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=testing test_type=CI  test_function="ok.pct90" | chart avg(transaction_RT_val) AS "90%_RT" by transaction,version | rename "99864.0.0" as Test1, "99867.0.0" as Test2 , "99868.0.0" as Test3 | eval Change1 = ((Test2-Test1)/Test2*100) | eval  Change2 = ((Test3-Test2)/Test3*100) | fields transaction, Change1, Change2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Preferably I want to filter the results to show a maximum of last 5 versions&lt;/P&gt;</description>
      <pubDate>Fri, 12 Feb 2016 15:46:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Renaming-column-names-field-value-in-a-search-result/m-p/202904#M58913</guid>
      <dc:creator>nitin_gurram</dc:creator>
      <dc:date>2016-02-12T15:46:47Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming column names(field value) in a search result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Renaming-column-names-field-value-in-a-search-result/m-p/202905#M58914</link>
      <description>&lt;P&gt;Try something like this (this is assuming that a version is available for all transactions)&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Update&lt;/STRONG&gt;&lt;BR /&gt;
I must've goofed up while pasting the answer. Here is the full search.&lt;/P&gt;

&lt;P&gt;Assumption: Every transaction has events for all versions. Version is in format &lt;CODE&gt;major.minor.build&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=testing test_type=CI  test_function="ok.pct90" | stats avg(transaction_RT_val) as transaction_RT_val by transaction,version | rex field=version "(?&amp;lt;major&amp;gt;\d+)\.(?&amp;lt;minor&amp;gt;\d+)\.(?&amp;lt;build&amp;gt;\d+)" | sort transaction major minor build | streamstats count as sno by transaction | eval version="Test".tostring(sno)  | chart avg(transaction_RT_val) AS "90%_RT" by transaction,version | eval Change1 = ((Test2-Test1)/Test2*100) | eval  Change2 = ((Test3-Test2)/Test3*100) | eval Change3 = ((Test4-Test3)/Test4*100) | eval  Change4 = ((Test5-Test4)/Test5*100) | fields transaction, Change*
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 12 Feb 2016 17:43:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Renaming-column-names-field-value-in-a-search-result/m-p/202905#M58914</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-02-12T17:43:03Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming column names(field value) in a search result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Renaming-column-names-field-value-in-a-search-result/m-p/202906#M58915</link>
      <description>&lt;P&gt;Hi! you almost wrote the same query that I wrote &lt;BR /&gt;
I got Test1,Test2 , Test3 by renaming version numbers those fields do not exist. note that version numbers are changing and they are not constants so I can't rename them &lt;/P&gt;</description>
      <pubDate>Mon, 15 Feb 2016 07:32:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Renaming-column-names-field-value-in-a-search-result/m-p/202906#M58915</guid>
      <dc:creator>nitin_gurram</dc:creator>
      <dc:date>2016-02-15T07:32:49Z</dc:date>
    </item>
  </channel>
</rss>

