Dashboards & Visualizations

condition is not working on input type="time"

arcotdeepika
Engager

created radio buttons and applied the condition, able to change value / label according selected value as condition,

But, when the same apply to time, it is not reflected in time values as earliest and latest.

check as below xml example.

Use tokens with conditional input choices

    <input type="radio" token="period_tok">
   <label>Select a time range</label>
        <choice value="-1d@d">1m</choice>
       <choice value="-5d@d">5m</choice>
  <default>Last 1Minute</default>

  <change>
    <condition label="1m">
            <set token="latestTime">-2d@d</set>
    </condition>
    <condition label="5m">
       <eval token="latestTime">relative_time($trxTime$,"+2d")</eval>
    </condition>
  </change>
</input>

 <input type="time"  searchWhenChanged="true" token="trxTime">
    <default>
           <earliest>-1d@d</earliest>
           <latest>now</latest>
     </default>  
           <earliest>$latestTime$</earliest>
           <latest>$latestTime</latest>


</input>

when I print $latestTime$ in dashboard it reflected value based on condition,but earliest and latest times in timepicker is not updating.

Can you please suggest here.

Thanks.

Tags (2)
0 Karma

sravankaripe
Communicator
<input type="radio" token="period_tok">
  <label>Select a time range</label>
  <choice value="-24h@h">Last 24 Hours</choice>
  <choice value="-7d@h">Last 7 Days</choice>
  <choice value="-30d@h">Last 30 Days</choice>
  <default>Last 24 Hours</default>

  <!-- set condition based on the label defined by <choice> -->
  <!-- Within each condition, specify a custom label for display -->
  <!-- Capture the selected value in the token, earliest_tok -->
  <change>
    <condition label="Last 24 Hours">
      <set token="date_label">Yesterday</set>
      <set token="earliest_tok">$value$</set>
    </condition>
    <condition label="Last 7 Days">
      <set token="date_label">Last week</set>
      <set token="earliest_tok">$value$</set>
    </condition>
    <condition label="Last 30 Days">
      <set token="date_label">Last month</set>
      <set token="earliest_tok">$value$</set>
    </condition>
  </change>
</input>
0 Karma

arcotdeepika
Engager

Thanks for response.

I tried the above, but its not solving my problem. with these code the token value indidually updating, but when I pass this value time, its not working. See the below code.

<label>Simple XML</label>
<description>A Simple Timerange with Conditional</description>
    <fieldset>
       <input type="radio" token="period_tok">
           <label>Select a time range</label>
           <choice value="-4d@h">1m</choice>
           <choice value="-14d@h">5m</choice>
           <choice value="-30d@h">15m</choice>
           <choice value="-90d@h">1h</choice>
           <default>Last 24 Hours</default>

           <!-- set condition based on the label defined by <choice> -->
           <!-- Within each condition, specify a custom label for display -->
           <!-- Capture the selected value in the token, earliest_tok -->
           <change>
             <condition label="1m">
               <set token="date_label">1minute</set>
               <set token="earliest_tok">$value$</set>
             </condition>
             <condition label="5m">
               <set token="date_label">5minutes</set>
               <set token="earliest_tok">$value$</set>
             </condition>
             <condition label="15m">
               <set token="date_label">15minutes</set>
               <set token="earliest_tok">$value$</set>
             </condition>
             <condition label="1h">
               <set token="date_label">1hour</set>
               <set token="earliest_tok">$value$</set>
             </condition>
         </change>
       </input>
      <input type="time">

            <earliest>$earliest_tok$</earliest>
            <latest>$earliest_tok$</latest>

      </input>


<row>
   <panel>

    <!-- Use tokens from the <input> elements in the panel title -->
    <title>
      Input selections: (radio):- "$period_tok$", $date_label$, (time):- "$earliest_tok$", $latest$
     </title> 
  </panel>

</row>
0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Design, Compete, Win: Submit Your Best Splunk Dashboards for a .conf26 Pass

Hello Splunkers,  We’re excited to kick off a Splunk Dashboard contest! We know that dashboards are a primary ...

May 2026 Splunk Expert Sessions: Security & Observability

Level Up Your Operations: May 2026 Splunk Expert Sessions Whether you are refining your security posture or ...

Network to App: Observability Unlocked [May & June Series]

In today’s digital landscape, your environment is no longer confined to the data center. It spans complex ...