Splunk Search

Why is timestamp not showing as the default in column1 when I load the dashboard?

vamsi354
Explorer

Hi Experts , i want to show Column1 timestamp selected as default in Date/Time Range From not sure what i am doing wrong but when i select the different date its updating


<fieldset submitButton="false" autoRun="false">
<input type="time" token="field2" searchWhenChanged="true">
<label>Column 1</label>
<default>
<earliest>1661144400</earliest>
<latest>1661230800</latest>
</default>
<change>
<eval token="timeRangeEarliestearliest">if(isnum($field2.earliest$), $field2.earliest$, relative_time(now(), $field2.earliest$))</eval>
<eval token="timeRangeLatestearliest">if(isnum($field2.latest$), $field2.latest$, relative_time(now(), $field2.latest$))</eval>
<eval token="prettyPrinttimeRangeFromTimeearliest">strftime($timeRangeEarliestearliest$, "%a, %e %b %Y")</eval>
<eval token="prettyPrinttimeRangeToTimeearliest">strftime($timeRangeLatestearliest$, "%a, %e %b %Y")</eval>
</change>
</input>
<input type="time" token="field1" searchWhenChanged="true">
<label>Column 2</label>
<default>
<earliest>@d</earliest>
<latest>now</latest>
</default>
<change>
<eval token="timeRangeEarliestlatest">if(isnum($field1.earliest$), $field1.earliest$, relative_time(now(), $field1.earliest$))</eval>
<eval token="timeRangeLatestlatest">if(isnum($field1.latest$), $field1.latest$, relative_time(now(), $field1.latest$))</eval>
<eval token="prettyPrinttimeRangeFromTimelatest">strftime($timeRangeEarliestlatest$, "%a, %e %b %Y")</eval>
<eval token="prettyPrinttimeRangeToTimelatest">strftime($timeRangeLatestlatest$, "%a, %e %b %Y")</eval>
</change>
</input>
</fieldset>
<row>
<panel>
<html>
<h3>Date/Time Range From</h3>
<table>
<tr>
<td>From:</td>
<td>$prettyPrinttimeRangeFromTimeearliest$</td>
</tr>
<tr>
<td>To:</td>
<td>$prettyPrinttimeRangeToTimeearliest$</td>
</tr>
</table>
</html>
</panel>
</row>
<row>
<panel>
<html>
<h3>Date/Time Range</h3>
<table>
<tr>
<td>From:</td>
<td>$prettyPrinttimeRangeFromTimelatest$</td>
</tr>
<tr>
<td>To:</td>
<td>$prettyPrinttimeRangeToTimelatest$</td>
</tr>
</table>
</html>
</panel>
</row>


vamsi354_0-1661792594851.png

 

Labels (1)
Tags (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

It is to do with the order in which things are executed when the dashboard displays. Try putting this in the init block at the top of the dashboard

<set token="form.field2.earliest">1661144400</set>
<set token="form.field2.latest">1661230800</set>

and remove the default section from the field2 input

vamsi354
Explorer

@ITWhisperer any idea on this

 

0 Karma
Get Updates on the Splunk Community!

Building Reliable Asset and Identity Frameworks in Splunk ES

 Accurate asset and identity resolution is the backbone of security operations. Without it, alerts are ...

Cloud Monitoring Console - Unlocking Greater Visibility in SVC Usage Reporting

For Splunk Cloud customers, understanding and optimizing Splunk Virtual Compute (SVC) usage and resource ...

Automatic Discovery Part 3: Practical Use Cases

If you’ve enabled Automatic Discovery in your install of the Splunk Distribution of the OpenTelemetry ...