<?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 can I change the header so it displays the current date? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-change-the-header-so-it-displays-the-current-date/m-p/366027#M107975</link>
    <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your current search giving fields OS Range 1... (gives output 1)
| eval today=strftime(now(),"%Y-%m-%d") 
| eval {today}=OS | fields - OS today
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 10 Aug 2017 20:14:13 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2017-08-10T20:14:13Z</dc:date>
    <item>
      <title>How can I change the header so it displays the current date?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-change-the-header-so-it-displays-the-current-date/m-p/366026#M107974</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have a table output like below,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;**OS**       Range1       Range2       Range3     Range4
AIX          10           20           30         40
HP-UX        50           60           70         80
Linux        90           100          110        120
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But I want a table like below,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;**2017-08-10** Range1       Range2       Range3   Range4
AIX            10           20           30       40
HP-UX          50           60           70       80
Linux          90           100          110      120
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Date should be change daily.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Aug 2017 19:58:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-change-the-header-so-it-displays-the-current-date/m-p/366026#M107974</guid>
      <dc:creator>sbbadri</dc:creator>
      <dc:date>2017-08-10T19:58:52Z</dc:date>
    </item>
    <item>
      <title>Re: How can I change the header so it displays the current date?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-change-the-header-so-it-displays-the-current-date/m-p/366027#M107975</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your current search giving fields OS Range 1... (gives output 1)
| eval today=strftime(now(),"%Y-%m-%d") 
| eval {today}=OS | fields - OS today
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 10 Aug 2017 20:14:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-change-the-header-so-it-displays-the-current-date/m-p/366027#M107975</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-08-10T20:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: How can I change the header so it displays the current date?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-change-the-header-so-it-displays-the-current-date/m-p/366028#M107976</link>
      <description>&lt;P&gt;Nope it is not working.  i need header label instead of os i need current date value.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Aug 2017 20:36:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-change-the-header-so-it-displays-the-current-date/m-p/366028#M107976</guid>
      <dc:creator>sbbadri</dc:creator>
      <dc:date>2017-08-10T20:36:01Z</dc:date>
    </item>
    <item>
      <title>Re: How can I change the header so it displays the current date?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-change-the-header-so-it-displays-the-current-date/m-p/366029#M107977</link>
      <description>&lt;P&gt;Can you provide what you get with my answer and what you expect?&lt;/P&gt;

&lt;P&gt;Runanywhere sample.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| gentimes start=-1 | eval OS="AIX" | table OS | eval Range1=30 | eval Range2=50
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Output&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;OS    Range1   Range2
AIX  30  50
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;With my answer&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| gentimes start=-1 | eval OS="AIX" | table OS | eval Range1=30 | eval Range2=50  | eval today=strftime(now(),"%Y-%m-%d") 
| eval {today}=OS | fields - today OS
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Output&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2017-08-10   Range1   Range2
AIX  30  50  
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 10 Aug 2017 20:44:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-change-the-header-so-it-displays-the-current-date/m-p/366029#M107977</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-08-10T20:44:53Z</dc:date>
    </item>
    <item>
      <title>Re: How can I change the header so it displays the current date?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-change-the-header-so-it-displays-the-current-date/m-p/366030#M107978</link>
      <description>&lt;P&gt;Query:&lt;/P&gt;

&lt;P&gt;| inputlookup SystemsUpTimeRange.csv WHERE (range="91-180 days") AND os=AIX AND os!=NA &lt;BR /&gt;
| stats sum(count) as tcount by _time os range &lt;BR /&gt;
| sort - _time &lt;BR /&gt;
| head 8 &lt;BR /&gt;
| rename tcount as 91_180_days &lt;BR /&gt;
| fields - range &lt;BR /&gt;
| delta 91_180_days as 91_180_days_c p=7 &lt;BR /&gt;
| tail 1 | ..... more query ............ | eval today=strftime(now(),"%Y-%m-%d") &lt;BR /&gt;
 | eval {today}=os | fields - os today | table 91_180_days 91_180_days_c 180_plus_days 180_plus_days_c  &lt;/P&gt;

&lt;P&gt;Ouput:&lt;/P&gt;

&lt;P&gt;91_180_days 91_180_days_c   180_plus_days   180_plus_days_c&lt;BR /&gt;
25  7   77  -6&lt;BR /&gt;
        6   0&lt;BR /&gt;
456 -20 142 -9&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:19:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-change-the-header-so-it-displays-the-current-date/m-p/366030#M107978</guid>
      <dc:creator>sbbadri</dc:creator>
      <dc:date>2020-09-29T15:19:59Z</dc:date>
    </item>
    <item>
      <title>Re: How can I change the header so it displays the current date?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-change-the-header-so-it-displays-the-current-date/m-p/366031#M107979</link>
      <description>&lt;P&gt;Your last table command is removing the field with today's date. Replace your last table command with this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| table * 91_180_days 91_180_days_c 180_plus_days 180_plus_days_c
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| table 2* 91_180_days 91_180_days_c 180_plus_days 180_plus_days_c
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 10 Aug 2017 21:11:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-change-the-header-so-it-displays-the-current-date/m-p/366031#M107979</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-08-10T21:11:39Z</dc:date>
    </item>
  </channel>
</rss>

