<?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: [Splunk + R] How do I dynamically rename the column name of results obtained from running an R script on a splunk query? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-R-How-do-I-dynamically-rename-the-column-name-of-results/m-p/270283#M17150</link>
    <description>&lt;P&gt;@martin_mueller thanks. &lt;BR /&gt;
Doing the above is changing the name dynamically but it is displaying only that specific column with only one value. how to display the results in my screen shot 'as is'  but only with a change of column name?&lt;/P&gt;</description>
    <pubDate>Mon, 12 Oct 2015 21:00:13 GMT</pubDate>
    <dc:creator>m_vivek</dc:creator>
    <dc:date>2015-10-12T21:00:13Z</dc:date>
    <item>
      <title>[Splunk + R] How do I dynamically rename the column name of results obtained from running an R script on a splunk query?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-R-How-do-I-dynamically-rename-the-column-name-of-results/m-p/270281#M17148</link>
      <description>&lt;P&gt;I have a splunk + R query :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=abcd host=pqrs*   earliest=07/01/2015:00:0:0 latest=07/02/2015:01:0:0 | fields DUR, TYPE | timechart limit=0 span=10m count, avg(DUR) by TYPE | eval dataset=1 | append[index=abcd host=pqrs*   earliest=07/03/2015:00:0:0 latest=07/04/2015:01:0:0 | fields DUR, TYPE | timechart limit=0 span=10m count, avg(DUR) by TYPE  | eval dataset=2] | r "   data= input 
.
.
.
output =  my_output"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;the output looks like this : &lt;BR /&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/728i344EB335F2FCA731/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Q.1&lt;/STRONG&gt;&lt;BR /&gt;
This kind of output is looked at every two weeks. How do I  rename the columns so that they also display a proper name along with the date range chosen in the query in &lt;STRONG&gt;Splunk&lt;/STRONG&gt;? &lt;BR /&gt;
Ex: I want the &lt;STRONG&gt;Count.Pre&lt;/STRONG&gt; column to look like &lt;STRONG&gt;Count 07/01 to 07/02&lt;/STRONG&gt;   , &lt;BR /&gt;
and &lt;STRONG&gt;Count.post&lt;/STRONG&gt;  as  &lt;STRONG&gt;Count 07/03 to 07/04&lt;/STRONG&gt;   and similarly for the other columns whose results are dependent on the date.&lt;BR /&gt;
 (I know renaming columns  can be done it in multiple ways using R) &lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Q.2&lt;/STRONG&gt; How do I do it dynamically? i.e if the date range in the query is changed the names of the columns in the results should also reflect the same change mentioned above.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Oct 2015 19:46:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-R-How-do-I-dynamically-rename-the-column-name-of-results/m-p/270281#M17148</guid>
      <dc:creator>m_vivek</dc:creator>
      <dc:date>2015-10-12T19:46:32Z</dc:date>
    </item>
    <item>
      <title>Re: [Splunk + R] How do I dynamically rename the column name of results obtained from running an R script on a splunk query?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-R-How-do-I-dynamically-rename-the-column-name-of-results/m-p/270282#M17149</link>
      <description>&lt;P&gt;Here's a run-anywhere non-R example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats count as Median.Pre | addinfo | eval dynamic_part = strftime(info_min_time, "%m/%d")." to ".strftime(info_max_time, "%m/%d") | eval Median {dynamic_part} = 'Median.Pre' | fields - info_* Median.Pre dynamic_part
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 12 Oct 2015 19:51:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-R-How-do-I-dynamically-rename-the-column-name-of-results/m-p/270282#M17149</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2015-10-12T19:51:43Z</dc:date>
    </item>
    <item>
      <title>Re: [Splunk + R] How do I dynamically rename the column name of results obtained from running an R script on a splunk query?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-R-How-do-I-dynamically-rename-the-column-name-of-results/m-p/270283#M17150</link>
      <description>&lt;P&gt;@martin_mueller thanks. &lt;BR /&gt;
Doing the above is changing the name dynamically but it is displaying only that specific column with only one value. how to display the results in my screen shot 'as is'  but only with a change of column name?&lt;/P&gt;</description>
      <pubDate>Mon, 12 Oct 2015 21:00:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-R-How-do-I-dynamically-rename-the-column-name-of-results/m-p/270283#M17150</guid>
      <dc:creator>m_vivek</dc:creator>
      <dc:date>2015-10-12T21:00:13Z</dc:date>
    </item>
    <item>
      <title>Re: [Splunk + R] How do I dynamically rename the column name of results obtained from running an R script on a splunk query?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-R-How-do-I-dynamically-rename-the-column-name-of-results/m-p/270284#M17151</link>
      <description>&lt;P&gt;The entire search I posted is a standalone dummy example. Paste it into an empty search bar and see what it does to the generated field, then adapt to your actual query.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Oct 2015 21:25:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-R-How-do-I-dynamically-rename-the-column-name-of-results/m-p/270284#M17151</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2015-10-12T21:25:18Z</dc:date>
    </item>
  </channel>
</rss>

