<?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: Renaming column at runtime without knowing at coding time their names. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Renaming-column-at-runtime-without-knowing-at-coding-time-their/m-p/247881#M73958</link>
    <description>&lt;P&gt;Thanks!&lt;BR /&gt;
I didn't use the timewrap for solving this issue but I will use it for other issues.&lt;/P&gt;</description>
    <pubDate>Mon, 29 Aug 2016 10:03:34 GMT</pubDate>
    <dc:creator>andreafebbo</dc:creator>
    <dc:date>2016-08-29T10:03:34Z</dc:date>
    <item>
      <title>Renaming column at runtime without knowing at coding time their names.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Renaming-column-at-runtime-without-knowing-at-coding-time-their/m-p/247877#M73954</link>
      <description>&lt;P&gt;Hi.&lt;BR /&gt;
I have the following query&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;BASE QUERY earliest=-7d latest=now | bucket _time span=7d |  stats count as events by  source _time |chart sum(events) by source, _time 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;this query gives me the column source and, in this case, 2 columns (that if i change earliest and span, become N columns).&lt;/P&gt;

&lt;P&gt;the deal is that those columns are names by the time, in some strange format (1471557600 and 1472162400).&lt;/P&gt;

&lt;P&gt;so, in this case, I have 3 columns: source - 1471557600 - 1472162400.&lt;/P&gt;

&lt;P&gt;I need to dynamically rename the columns by position, without knowing their names at run time.&lt;/P&gt;

&lt;P&gt;Is there some command like: rename the 2nd column = "this week" ans the 3rd column = "last week" ?&lt;/P&gt;

&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2016 09:03:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Renaming-column-at-runtime-without-knowing-at-coding-time-their/m-p/247877#M73954</guid>
      <dc:creator>andreafebbo</dc:creator>
      <dc:date>2016-08-26T09:03:30Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming column at runtime without knowing at coding time their names.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Renaming-column-at-runtime-without-knowing-at-coding-time-their/m-p/247878#M73955</link>
      <description>&lt;P&gt;Have you considered using the timewrap command?&lt;/P&gt;

&lt;P&gt;&lt;A href="https://splunkbase.splunk.com/app/1645/"&gt;https://splunkbase.splunk.com/app/1645/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2016 11:41:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Renaming-column-at-runtime-without-knowing-at-coding-time-their/m-p/247878#M73955</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2016-08-26T11:41:19Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming column at runtime without knowing at coding time their names.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Renaming-column-at-runtime-without-knowing-at-coding-time-their/m-p/247879#M73956</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; BASE QUERY earliest=-14d latest=now | eval when=if(_time&amp;gt;relative_time(now(), "-7d@d"), "Current Week, "Prev Week") |  stats count as events by  source when |chart sum(events) by source, when
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 26 Aug 2016 13:10:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Renaming-column-at-runtime-without-knowing-at-coding-time-their/m-p/247879#M73956</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-08-26T13:10:19Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming column at runtime without knowing at coding time their names.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Renaming-column-at-runtime-without-knowing-at-coding-time-their/m-p/247880#M73957</link>
      <description>&lt;P&gt;I works!&lt;BR /&gt;
Thanks a lot!&lt;/P&gt;</description>
      <pubDate>Mon, 29 Aug 2016 10:02:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Renaming-column-at-runtime-without-knowing-at-coding-time-their/m-p/247880#M73957</guid>
      <dc:creator>andreafebbo</dc:creator>
      <dc:date>2016-08-29T10:02:41Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming column at runtime without knowing at coding time their names.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Renaming-column-at-runtime-without-knowing-at-coding-time-their/m-p/247881#M73958</link>
      <description>&lt;P&gt;Thanks!&lt;BR /&gt;
I didn't use the timewrap for solving this issue but I will use it for other issues.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Aug 2016 10:03:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Renaming-column-at-runtime-without-knowing-at-coding-time-their/m-p/247881#M73958</guid>
      <dc:creator>andreafebbo</dc:creator>
      <dc:date>2016-08-29T10:03:34Z</dc:date>
    </item>
  </channel>
</rss>

