<?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: Why is the time Input Token(Range) not working in our dashboard panel query? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-the-time-Input-Token-Range-not-working-in-our-dashboard/m-p/389878#M25586</link>
    <description>&lt;P&gt;Thanks martin for the response,I tweaked the query to use strpttime() and strftime() in right places.It's working good.Here is the final query used.&lt;BR /&gt;
index="booking_history" | dbxlookup lookup=PROVIDER_LOOKUP |eval earlyDate=strftime("$time_range.earliest$", "%Y-%m-%d")|  eval latestDate=strftime("$time_range.latest$", "%Y-%m-%d")| eval apptDate=strptime(APPT_DATE, "%Y-%m-%d %H:%M:%S")|eval apptDate1=strftime(apptDate, "%Y-%m-%d")|where apptDate1&amp;gt;=earlyDate AND apptDate1&amp;lt;=latestDate  |table APPT_DATE VISIT_TYPE_CID VISIT_TYPE_NAME earlyDate latestDate apptDate1 | chart count(VISIT_TYPE_CID) over apptDate1 by VISIT_TYPE_NAME&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 22:03:50 GMT</pubDate>
    <dc:creator>sureshkrovi</dc:creator>
    <dc:date>2020-09-29T22:03:50Z</dc:date>
    <item>
      <title>Why is the time Input Token(Range) not working in our dashboard panel query?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-the-time-Input-Token-Range-not-working-in-our-dashboard/m-p/389876#M25584</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Can you please help me to understand how to use the time input token range for the below scenarios? I'm having issues dealing with the time range filter in dashboard query.&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;P&gt;Oracle table added to splunk using DBconnect&lt;BR /&gt;
ProviderID  Booked_Date Time    Visit_Type&lt;BR /&gt;
1                11/1/2018        10AM  Office&lt;BR /&gt;
1                11/1/2018        11AM  Telephone&lt;BR /&gt;
2                11/2/2018        10AM  Telephone&lt;BR /&gt;
3                11/5/2018           3PM              Office&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Look up crated to get Name for provider ID that is working good with static query.&lt;/P&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;&lt;CODE&gt;index="booking_history" | dbxlookup lookup=PROVIDER_LOOKUP | eval myDate=strptime(BOOKED_DATE, "%Y-%m-%d")&lt;BR /&gt;
    | where myDate=strptime("11/1/2018", "%Y-%m-%d")  | chart count(VISIT_TYPE_CID) over APPT_DATE by VISIT_TYPE_NAME&lt;/CODE&gt;&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;Time input field(form( created with token "time_input" and below  query returns no records though splunk have events.&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;&lt;CODE&gt;index="booking_history" | dbxlookup lookup=PROVIDER_LOOKUP | eval myDate=strptime(BOOKED_DATE, "%Y-%m-%d")&lt;BR /&gt;
| where myDate&amp;gt;=strptime("$time_input.latest$", "%Y-%m-%d")  AND  myDate&amp;lt;=strptime("$time_input.latest$", "%Y-%m-%d") | chart count(VISIT_TYPE_CID) over APPT_DATE by VISIT_TYPE_NAME&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Note: Getting long integers when trying to retrieve "time_input" from UI.&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:02:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-the-time-Input-Token-Range-not-working-in-our-dashboard/m-p/389876#M25584</guid>
      <dc:creator>sureshkrovi</dc:creator>
      <dc:date>2020-09-29T22:02:11Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the time Input Token(Range) not working in our dashboard panel query?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-the-time-Input-Token-Range-not-working-in-our-dashboard/m-p/389877#M25585</link>
      <description>&lt;P&gt;If you're seeing long integers then you're seeing epoch timestamps. You don't need to put them through &lt;CODE&gt;strptime()&lt;/CODE&gt;, they already have the unit/format &lt;CODE&gt;strptime()&lt;/CODE&gt; would return. You can compare them to &lt;CODE&gt;myDate&lt;/CODE&gt; directly.&lt;/P&gt;

&lt;P&gt;Side note, you're using &lt;CODE&gt;$time_input.latest$&lt;/CODE&gt; twice. You probably want &lt;CODE&gt;$time_input.earliest$&lt;/CODE&gt; for the first comparison.&lt;/P&gt;</description>
      <pubDate>Sat, 10 Nov 2018 06:14:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-the-time-Input-Token-Range-not-working-in-our-dashboard/m-p/389877#M25585</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2018-11-10T06:14:08Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the time Input Token(Range) not working in our dashboard panel query?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-the-time-Input-Token-Range-not-working-in-our-dashboard/m-p/389878#M25586</link>
      <description>&lt;P&gt;Thanks martin for the response,I tweaked the query to use strpttime() and strftime() in right places.It's working good.Here is the final query used.&lt;BR /&gt;
index="booking_history" | dbxlookup lookup=PROVIDER_LOOKUP |eval earlyDate=strftime("$time_range.earliest$", "%Y-%m-%d")|  eval latestDate=strftime("$time_range.latest$", "%Y-%m-%d")| eval apptDate=strptime(APPT_DATE, "%Y-%m-%d %H:%M:%S")|eval apptDate1=strftime(apptDate, "%Y-%m-%d")|where apptDate1&amp;gt;=earlyDate AND apptDate1&amp;lt;=latestDate  |table APPT_DATE VISIT_TYPE_CID VISIT_TYPE_NAME earlyDate latestDate apptDate1 | chart count(VISIT_TYPE_CID) over apptDate1 by VISIT_TYPE_NAME&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:03:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-the-time-Input-Token-Range-not-working-in-our-dashboard/m-p/389878#M25586</guid>
      <dc:creator>sureshkrovi</dc:creator>
      <dc:date>2020-09-29T22:03:50Z</dc:date>
    </item>
  </channel>
</rss>

