<?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 to display the exact date from time modifiers? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-the-exact-date-from-time-modifiers/m-p/408860#M118003</link>
    <description>&lt;P&gt;Hi @akarivaratharaj,&lt;/P&gt;

&lt;P&gt;Can you please try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;eval token="growth_title2"&amp;gt;strftime(relative_time(now(), earliest), "%d-%m-%Y")." to ".strftime(relative_time(now(), latest), "%d-%m-%Y")&amp;lt;/eval&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For reference:&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.2.5/SearchReference/DateandTimeFunctions"&gt;https://docs.splunk.com/Documentation/Splunk/7.2.5/SearchReference/DateandTimeFunctions&lt;/A&gt;&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.2.5/Viz/tokens#Define_conditional_matching"&gt;https://docs.splunk.com/Documentation/Splunk/7.2.5/Viz/tokens#Define_conditional_matching&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 16 Apr 2019 09:58:48 GMT</pubDate>
    <dc:creator>harshpatel</dc:creator>
    <dc:date>2019-04-16T09:58:48Z</dc:date>
    <item>
      <title>How to display the exact date from time modifiers?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-the-exact-date-from-time-modifiers/m-p/408859#M118002</link>
      <description>&lt;P&gt;I would like to know how to display the exact date of the time modifiers which are specified in the earliest and latest time range.&lt;BR /&gt;
Eg: &lt;CODE&gt;earliest=-1q@q&lt;/CODE&gt; &lt;CODE&gt;latest=@q&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;We know that this is nothing but the last quarter details, which is earliest =01-01-2019 and latest=31-03-2019.&lt;BR /&gt;
I am using the time modifier in my query and I want to display the above format date along with my other panels in my dashboard.&lt;BR /&gt;
This may change according to each quarter/year we select from input.&lt;/P&gt;

&lt;P&gt;I am using this in a case condition,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;condition&amp;gt;
        &amp;lt;eval token="growth_title2"&amp;gt;case($result.time_period$=="earliest=-1q@q latest=@q","xxxx", $result.time_period$=="earliest=-1y@y latest=@y", "yyyy")&amp;lt;/eval&amp;gt;
      &amp;lt;/condition&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The place &lt;CODE&gt;xxxx&lt;/CODE&gt; and &lt;CODE&gt;yyyy&lt;/CODE&gt; needed the logic to display the earliest &amp;amp; latest time in date format&lt;/P&gt;

&lt;P&gt;Could anyone please help me to display time which is mentioned in time modifier as date format.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Apr 2019 09:09:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-the-exact-date-from-time-modifiers/m-p/408859#M118002</guid>
      <dc:creator>akarivaratharaj</dc:creator>
      <dc:date>2019-04-16T09:09:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to display the exact date from time modifiers?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-the-exact-date-from-time-modifiers/m-p/408860#M118003</link>
      <description>&lt;P&gt;Hi @akarivaratharaj,&lt;/P&gt;

&lt;P&gt;Can you please try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;eval token="growth_title2"&amp;gt;strftime(relative_time(now(), earliest), "%d-%m-%Y")." to ".strftime(relative_time(now(), latest), "%d-%m-%Y")&amp;lt;/eval&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For reference:&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.2.5/SearchReference/DateandTimeFunctions"&gt;https://docs.splunk.com/Documentation/Splunk/7.2.5/SearchReference/DateandTimeFunctions&lt;/A&gt;&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.2.5/Viz/tokens#Define_conditional_matching"&gt;https://docs.splunk.com/Documentation/Splunk/7.2.5/Viz/tokens#Define_conditional_matching&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Apr 2019 09:58:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-the-exact-date-from-time-modifiers/m-p/408860#M118003</guid>
      <dc:creator>harshpatel</dc:creator>
      <dc:date>2019-04-16T09:58:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to display the exact date from time modifiers?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-the-exact-date-from-time-modifiers/m-p/408861#M118004</link>
      <description>&lt;P&gt;I have no idea what you mean by this.  More explanation is required.  Perhaps show examples.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Apr 2019 12:31:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-the-exact-date-from-time-modifiers/m-p/408861#M118004</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-04-16T12:31:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to display the exact date from time modifiers?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-the-exact-date-from-time-modifiers/m-p/408862#M118005</link>
      <description>&lt;P&gt;@harshpatel &lt;BR /&gt;
I modified this for my requirements. Works like a charm.&lt;BR /&gt;
Thanks and God bless,&lt;BR /&gt;
Genesius&lt;/P&gt;</description>
      <pubDate>Wed, 01 Apr 2020 18:38:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-the-exact-date-from-time-modifiers/m-p/408862#M118005</guid>
      <dc:creator>genesiusj</dc:creator>
      <dc:date>2020-04-01T18:38:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to display the exact date from time modifiers?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-the-exact-date-from-time-modifiers/m-p/408863#M118006</link>
      <description>&lt;P&gt;@genesiusj  Glad to hear it.&lt;/P&gt;

&lt;P&gt;Cheers,&lt;BR /&gt;
Harsh&lt;/P&gt;</description>
      <pubDate>Mon, 06 Apr 2020 16:00:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-the-exact-date-from-time-modifiers/m-p/408863#M118006</guid>
      <dc:creator>harshpatel</dc:creator>
      <dc:date>2020-04-06T16:00:16Z</dc:date>
    </item>
  </channel>
</rss>

