Dashboards & Visualizations

How to initialize a time token earliest during dashboard refresh?

MadhuAgineati
Loves-to-Learn Lots

hi ,

i did some modifications to the time token earliest and latest as per my requirement as shown below.

<input type="time" token="time_picker" searchWhenChanged="true">
<label>Time Picker</label>
<change>
<eval token="my_earliest">if(isnum($time_picker.earliest$),$time_picker.earliest$,relative_time(now(),$time_picker.earliest$))</eval>
<eval token="my_latest">if(isnum($time_picker.latest$),$time_picker.latest$,relative_time(now(),$time_picker.latest$))</eval>
<eval token="my_now">now()</eval>
<eval token="final_earliest">strftime($my_earliest$,"%m/%d/%Y:%H:%M:%S")</eval>
<eval token="modified_axs">if($my_latest$==$my_now$,$my_latest$-60,$my_latest$)</eval>
<eval token="modified_prex">if($my_latest$==$my_now$,$my_latest$,$my_latest$+60)</eval>
<eval token="final_latest_axs">strftime(modified_axs,"%m/%d/%Y:%H:%M:%S")</eval>
<eval token="final_latest_prex">strftime(modified_prex,"%m/%d/%Y:%H:%M:%S")</eval>
</change>
<default>
<earliest>-15m</earliest>
<latest>now</latest>
</default>
</input>

Now, when i refresh the dashboard i am getting  the error , it is not picking the default earliest. it is taking time_picker.earliest as now(). i want to set it for -15m during dashboard refresh 

Error in 'search' command: Unable to parse the search: Invalid time bounds in search: start=1652905253 > end=1652905193.

how can i solve this issue ? @niketn 

Labels (1)
Tags (1)
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!

[Puzzles] Solve, Learn, Repeat: Character substitutions with Regular Expressions

This challenge was first posted on Slack #puzzles channelFor BORE at .conf23, we had a puzzle question which ...

Splunk Community Badges!

  Hey everyone! Ready to earn some serious bragging rights in the community? Along with our existing badges ...

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...