<?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: Problem in enhancing search range by a Day before than actual selected range, ex : if user selects today, show today+yesterday results. in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Problem-in-enhancing-search-range-by-a-Day-before-than-actual/m-p/364966#M23843</link>
    <description>&lt;P&gt;@bharathdoitnow, have you tried the run anywhere dashboard above.&lt;/P&gt;</description>
    <pubDate>Tue, 20 Mar 2018 13:30:56 GMT</pubDate>
    <dc:creator>niketn</dc:creator>
    <dc:date>2018-03-20T13:30:56Z</dc:date>
    <item>
      <title>Problem in enhancing search range by a Day before than actual selected range, ex : if user selects today, show today+yesterday results.</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Problem-in-enhancing-search-range-by-a-Day-before-than-actual/m-p/364963#M23840</link>
      <description>&lt;P&gt;I am creating a dashboard which shows results based on search range.&lt;BR /&gt;&lt;BR /&gt;
Problem Statement : &lt;BR /&gt;
1. user fills a form in the web application.&lt;BR /&gt;
2. Logs into Splunk dashboard and looks for logs by choosing "today" in time picker&lt;BR /&gt;
3. no results comes up as the logs were tagged under a day before time stamp.&lt;BR /&gt;
4. when user changes time to yesterday or last 2 days, results are shown.&lt;/P&gt;

&lt;P&gt;So I want to enhance the user search range + 1 day before in the back end. I tried to do but it is is not working as expected.&lt;/P&gt;

&lt;P&gt;What I tried:&lt;/P&gt;

&lt;P&gt;Time picker:&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/4575iA9DCB27239724502/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Mar 2018 04:52:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Problem-in-enhancing-search-range-by-a-Day-before-than-actual/m-p/364963#M23840</guid>
      <dc:creator>bharathdoitnow</dc:creator>
      <dc:date>2018-03-20T04:52:15Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in enhancing search range by a Day before than actual selected range, ex : if user selects today, show today+yesterday results.</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Problem-in-enhancing-search-range-by-a-Day-before-than-actual/m-p/364964#M23841</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;     &amp;lt;earliest&amp;gt;$shared_time.earliest$-24h&amp;lt;/earliest&amp;gt; earliest time in screenshot was a typo, anyway thats not a working solution.
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 20 Mar 2018 05:36:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Problem-in-enhancing-search-range-by-a-Day-before-than-actual/m-p/364964#M23841</guid>
      <dc:creator>bharathdoitnow</dc:creator>
      <dc:date>2018-03-20T05:36:20Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in enhancing search range by a Day before than actual selected range, ex : if user selects today, show today+yesterday results.</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Problem-in-enhancing-search-range-by-a-Day-before-than-actual/m-p/364965#M23842</link>
      <description>&lt;P&gt;@bharathdoitnow, you would need to pass on the Time input tokens to a dummy search and then use &lt;CODE&gt;$job.earliestTime$&lt;/CODE&gt;&lt;BR /&gt;
which is default token for &lt;CODE&gt;&amp;lt;search&amp;gt;&lt;/CODE&gt; handler. PS: As per your question you need to show &lt;CODE&gt;-24h&lt;/CODE&gt; data along with selected time range, which means you don't need to adjust &lt;CODE&gt;latest&lt;/CODE&gt; time just the &lt;CODE&gt;earliest&lt;/CODE&gt; time. You can also refer to my previous answer for details (one more solution approach using &lt;CODE&gt;addinfo&lt;/CODE&gt; &lt;A href="https://answers.splunk.com/answers/578984/running-one-of-two-searches-based-on-time-picker-s.html"&gt;https://answers.splunk.com/answers/578984/running-one-of-two-searches-based-on-time-picker-s.html&lt;/A&gt;)&lt;/P&gt;

&lt;P&gt;Please try the following run anywhere dashboard and confirm:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
  &amp;lt;label&amp;gt;Adjust Search Earliest Time&amp;lt;/label&amp;gt;
  &amp;lt;fieldset submitButton="false"&amp;gt;
    &amp;lt;input type="time" token="tokTime"&amp;gt;
      &amp;lt;label&amp;gt;&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;
        &amp;lt;earliest&amp;gt;-24h@h&amp;lt;/earliest&amp;gt;
        &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
      &amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
  &amp;lt;search&amp;gt;
    &amp;lt;query&amp;gt;| makeresults
    &amp;lt;/query&amp;gt;
    &amp;lt;done&amp;gt;
      &amp;lt;set token="tokAdjustedEarliestTimeString"&amp;gt;$job.earliestTime$&amp;lt;/set&amp;gt;
      &amp;lt;eval token="tokAdjustedEarliestTimeEpoch"&amp;gt;relative_time(strptime($job.earliestTime$,"%Y/%m/%dT%H:%M:%S"),"-24h")&amp;lt;/eval&amp;gt;
    &amp;lt;/done&amp;gt;
    &amp;lt;earliest&amp;gt;$tokTime.earliest$&amp;lt;/earliest&amp;gt;
    &amp;lt;latest&amp;gt;$tokTime.latest$&amp;lt;/latest&amp;gt;
  &amp;lt;/search&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;title&amp;gt;tokAdjustedEarliestTimeString: "$tokAdjustedEarliestTimeString$" | tokAdjustedEarliestTimeEpoch= "$tokAdjustedEarliestTimeEpoch$"&amp;lt;/title&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;index=_internal sourcetype=splunkd log_level!=INFO
          | timechart count&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;$tokAdjustedEarliestTimeEpoch$&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;$tokTime.latest$&amp;lt;/latest&amp;gt;          
        &amp;lt;/search&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 20 Mar 2018 06:04:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Problem-in-enhancing-search-range-by-a-Day-before-than-actual/m-p/364965#M23842</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-03-20T06:04:42Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in enhancing search range by a Day before than actual selected range, ex : if user selects today, show today+yesterday results.</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Problem-in-enhancing-search-range-by-a-Day-before-than-actual/m-p/364966#M23843</link>
      <description>&lt;P&gt;@bharathdoitnow, have you tried the run anywhere dashboard above.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Mar 2018 13:30:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Problem-in-enhancing-search-range-by-a-Day-before-than-actual/m-p/364966#M23843</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-03-20T13:30:56Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in enhancing search range by a Day before than actual selected range, ex : if user selects today, show today+yesterday results.</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Problem-in-enhancing-search-range-by-a-Day-before-than-actual/m-p/364967#M23844</link>
      <description>&lt;P&gt;Thank you @Niketnilay, It looks very easy now. I am trying it out today....&lt;/P&gt;</description>
      <pubDate>Fri, 23 Mar 2018 02:34:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Problem-in-enhancing-search-range-by-a-Day-before-than-actual/m-p/364967#M23844</guid>
      <dc:creator>bharathdoitnow</dc:creator>
      <dc:date>2018-03-23T02:34:39Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in enhancing search range by a Day before than actual selected range, ex : if user selects today, show today+yesterday results.</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Problem-in-enhancing-search-range-by-a-Day-before-than-actual/m-p/364968#M23845</link>
      <description>&lt;P&gt;@bharathdoitnow, sure if it makes sense surely it would work. Try out and confirm! All the best &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Mar 2018 04:15:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Problem-in-enhancing-search-range-by-a-Day-before-than-actual/m-p/364968#M23845</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-03-23T04:15:43Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in enhancing search range by a Day before than actual selected range, ex : if user selects today, show today+yesterday results.</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Problem-in-enhancing-search-range-by-a-Day-before-than-actual/m-p/364969#M23846</link>
      <description>&lt;P&gt;@niketnilay Thank you for the answer.. It worked  and Solved my Major issue to search with a standard Timestamp.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Mar 2018 04:19:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Problem-in-enhancing-search-range-by-a-Day-before-than-actual/m-p/364969#M23846</guid>
      <dc:creator>bharathdoitnow</dc:creator>
      <dc:date>2018-03-26T04:19:38Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in enhancing search range by a Day before than actual selected range, ex : if user selects today, show today+yesterday results.</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Problem-in-enhancing-search-range-by-a-Day-before-than-actual/m-p/364970#M23847</link>
      <description>&lt;P&gt;@bharathdoitnow, if it worked for you please dont forget to accept the answers and up vote the comments that helped!&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jun 2018 17:39:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Problem-in-enhancing-search-range-by-a-Day-before-than-actual/m-p/364970#M23847</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-06-04T17:39:42Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in enhancing search range by a Day before than actual selected range, ex : if user selects today, show today+yesterday results.</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Problem-in-enhancing-search-range-by-a-Day-before-than-actual/m-p/364971#M23848</link>
      <description>&lt;P&gt;@bharathdoitnow stumbled on this old post. If your issue was resolved kindly accept this answer to mark the question as answered and assist others facing similar issue! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 29 Dec 2018 14:31:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Problem-in-enhancing-search-range-by-a-Day-before-than-actual/m-p/364971#M23848</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-12-29T14:31:44Z</dc:date>
    </item>
  </channel>
</rss>

