<?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 Is there a Form Element that will accept a single datetime value? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Is-there-a-Form-Element-that-will-accept-a-single-datetime-value/m-p/605893#M49754</link>
    <description>&lt;P&gt;Is there a form element that accepts only a single datetime value?&lt;/P&gt;
&lt;P&gt;User will be entering two fields, field 1 as&amp;nbsp; a single datetime and field 2 as a duration like "1h".&lt;/P&gt;
&lt;P&gt;Based on this two inputs, need to calculate and set time values as below&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For eg:&lt;/P&gt;
&lt;P&gt;User input field 1[TimeTokenMid] --&amp;gt;&amp;nbsp;07/12/2022:18:00:00&lt;/P&gt;
&lt;P&gt;User input field 2[Duration] --&amp;gt; "1h"&lt;/P&gt;
&lt;P&gt;Need to calculate and set time ranges as below using relative_time function.&lt;/P&gt;
&lt;P&gt;Token_1 =&amp;nbsp;07/12/2022:17:00:00 [TimeTokenMid - Duration using relative_time fnc]&lt;/P&gt;
&lt;P&gt;Token_2 =&amp;nbsp;07/12/2022:19:00:00 [TimeTokenMid + Duration using relative_time fnc]&lt;/P&gt;
&lt;P&gt;Currently i am taking field 1[TimeTokenMid] as text and doing calculation as the current timepicker control is not allowing to set a single custom time value. It has options only for selecting a range like (last 60 mins, between x and y etc)like that. In my usecase,I want to take a single timevalue input and calculate time ranges(+-) based on the duration input dynamically. Could you please suggest any solution?&lt;/P&gt;</description>
    <pubDate>Mon, 18 Jul 2022 14:09:08 GMT</pubDate>
    <dc:creator>Ashwin3</dc:creator>
    <dc:date>2022-07-18T14:09:08Z</dc:date>
    <item>
      <title>Is there a Form Element that will accept a single datetime value?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Is-there-a-Form-Element-that-will-accept-a-single-datetime-value/m-p/605893#M49754</link>
      <description>&lt;P&gt;Is there a form element that accepts only a single datetime value?&lt;/P&gt;
&lt;P&gt;User will be entering two fields, field 1 as&amp;nbsp; a single datetime and field 2 as a duration like "1h".&lt;/P&gt;
&lt;P&gt;Based on this two inputs, need to calculate and set time values as below&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For eg:&lt;/P&gt;
&lt;P&gt;User input field 1[TimeTokenMid] --&amp;gt;&amp;nbsp;07/12/2022:18:00:00&lt;/P&gt;
&lt;P&gt;User input field 2[Duration] --&amp;gt; "1h"&lt;/P&gt;
&lt;P&gt;Need to calculate and set time ranges as below using relative_time function.&lt;/P&gt;
&lt;P&gt;Token_1 =&amp;nbsp;07/12/2022:17:00:00 [TimeTokenMid - Duration using relative_time fnc]&lt;/P&gt;
&lt;P&gt;Token_2 =&amp;nbsp;07/12/2022:19:00:00 [TimeTokenMid + Duration using relative_time fnc]&lt;/P&gt;
&lt;P&gt;Currently i am taking field 1[TimeTokenMid] as text and doing calculation as the current timepicker control is not allowing to set a single custom time value. It has options only for selecting a range like (last 60 mins, between x and y etc)like that. In my usecase,I want to take a single timevalue input and calculate time ranges(+-) based on the duration input dynamically. Could you please suggest any solution?&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jul 2022 14:09:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Is-there-a-Form-Element-that-will-accept-a-single-datetime-value/m-p/605893#M49754</guid>
      <dc:creator>Ashwin3</dc:creator>
      <dc:date>2022-07-18T14:09:08Z</dc:date>
    </item>
    <item>
      <title>From Element that will accept a single datettime value</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Is-there-a-Form-Element-that-will-accept-a-single-datetime-value/m-p/605906#M49756</link>
      <description>&lt;P&gt;One way is to use &amp;lt;eval token /&amp;gt; under &amp;lt;progress /&amp;gt;&amp;nbsp;with a fake search, as inspired by .&lt;/P&gt;&lt;P&gt;For example,&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;form&amp;gt;
  &amp;lt;label&amp;gt;Set time window&amp;lt;/label&amp;gt;
  &amp;lt;search&amp;gt;
    &amp;lt;query&amp;gt;
      | makeresults
    &amp;lt;/query&amp;gt;
    &amp;lt;progress&amp;gt;
      &amp;lt;condition match="true()"&amp;gt;
        &amp;lt;eval token="latest_tok"&amp;gt;strftime(relative_time(strptime($Token_1$, "%m/%d/%Y:%H:%M:%S"), "+" . $Token_2$), "%m/%d/%Y:%H:%M:%S")&amp;lt;/eval&amp;gt;
      &amp;lt;/condition&amp;gt;
    &amp;lt;/progress&amp;gt;
  &amp;lt;/search&amp;gt;
  &amp;lt;fieldset submitButton="false"&amp;gt;
    &amp;lt;input type="dropdown" token="Token_1" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;start time&amp;lt;/label&amp;gt;
      &amp;lt;choice value="07/12/2022:17:00:00"&amp;gt;07/12/2022:17:00:00&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="07/13/2022:17:00:00"&amp;gt;07/13/2022:17:00:00&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="07/14/2022:17:00:00"&amp;gt;07/14/2022:17:00:00&amp;lt;/choice&amp;gt;
      &amp;lt;initialValue&amp;gt;07/12/2022:17:00:00&amp;lt;/initialValue&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="dropdown" token="Token_2" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;interval&amp;lt;/label&amp;gt;
      &amp;lt;choice value="2h"&amp;gt;2h&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="4h"&amp;gt;4h&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="8h"&amp;gt;8h&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="12h"&amp;gt;12h&amp;lt;/choice&amp;gt;
      &amp;lt;default&amp;gt;2h&amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;html&amp;gt;
        &amp;lt;div&amp;gt;latest token: $latest_tok$&amp;lt;/div&amp;gt;
      &amp;lt;/html&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/form&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jul 2022 01:11:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Is-there-a-Form-Element-that-will-accept-a-single-datetime-value/m-p/605906#M49756</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-07-18T01:11:05Z</dc:date>
    </item>
  </channel>
</rss>

