Oh yes sorry about that, I was trying to do an eval statement before the subsearch so I had added that in. Here is the XML for what I just tried using the gentimes approach, which returns no results:
<form>
<label>Test_timepicker Clone</label>
<fieldset submitButton="false">
<input type="time" searchWhenChanged="true">
<label></label>
</input>
</fieldset>
<row>
<panel>
<chart>
<search>
<query>
index=sm9_us source=interaction
[
| gentimes start=-1
| addinfo
| rename info_min_time as earliest, info_max_time as latest
| fields earliest latest
| eval search = "(" + earliest + " lt; _time AND _time lt;" + latest + ")"
| return $search
]
| timechart count span=1d
</query>
<sampleRatio>1</sampleRatio>
</search>
</chart>
</panel>
</row>
</form>
However, I did just find an alternate way to do this which seems to work as expected:
<form>
<label>Test_timepicker</label>
<fieldset submitButton="false">
<input type="time" searchWhenChanged="true">
<label></label>
<default>
<earliest>-7d@w0</earliest>
<latest>@w0</latest>
</default>
<change>
<condition match="isnum($earliest$) OR isnum($latest$)">
<eval token="etok">$earliest$</eval>
<eval token="ltok">$latest$</eval>
</condition>
<condition>
<eval token="etok">relative_time(now(), $earliest$)</eval>
<eval token="ltok">relative_time(now(), $latest$)</eval>
</condition>
</change>
</input>
</fieldset>
<row>
<panel>
<title>Earliest: $etok$ Latest:$ltok$</title>
<chart>
<search>
<query>
index=sm9_us source=interaction OPEN_TIME_LOCAL_TZ>$etok$ OPEN_TIME_LOCAL_TZ<$ltok$
| eval _time=OPEN_TIME_LOCAL_TZ
| dedup INTERACTION_ID
| timechart count span=1d </query>
<sampleRatio>1</sampleRatio>
</search>
</chart>
</panel>
</row>
</form>
It appears that the isnum() logical test won't return a malformed search when it's used within the input->change->condition tag. I've tried multiple presets and time ranges, and they all come back as epoch times. So now, as long as my other time fields is stored as an epoch time (e.g., OPEN_TIME_LOCAL_TZ in example above), then this works as expected.
... View more