Hello Splunkers I have a dropdown that calculates week_start for the last whole year. Then it has to pick "last_week" as default. I noticed that the dropdown, instead of remembering the label, adds the value to <default></default> I've tried to calculate last_week as a token and added to <default></default>, which it picks up correctly. But shows the epoch time in the dropdown instead of selecting the corresponding label "Last Week". Code for defining the dropdown search and initialising the token $last_week$: <fieldset submitButton="false">
<input type="dropdown" token="week">
<label>week</label>
<fieldForLabel>time</fieldForLabel>
<fieldForValue>start_time</fieldForValue>
<search>
<query>| makeresults count=52
| fields - _time
| streamstats count
| eval count=count-1
| eval start_time = relative_time(now(),"-".count."w@w+1d")
| eval time = case(count==1, "Last week", count==0, "Current week", 1==1, strftime(start_time,"%a %d-%b-%Y"))
| table time, start_time
| eval start_time=round(start_time,0)</query>
<earliest>-24h@h</earliest>
<latest>now</latest>
</search>
<default>$last_week$</default>
<initialValue>$last_week$</initialValue>
</input>
</fieldset>
-- The token initialisation that calculates last week wrt now():
<init>
<eval token="last_week">relative_time(now(),"-1w@w+1d")</eval>
</init>
... View more