Dashboards & Visualizations

Splunk Dashboard Studio - populate Current date as defaul value in input Text box

ravikumarsri
Observer

Hi Experts,

I am trying to convert a Splunk classic XML dashboard to  Splunk Dashboard Studio.

Below is my classic XML dashboard  code.

<fieldset autoRun="True" submitButton="false">
<input type="text" token="SelectedDay" searchWhenChanged="true">
<label>Enter Date (MM/DD/YYYY)</label>
<default>$CurDate$</default>
</input>
</fieldset>

The above code got converted to Splunk Dashboard Studio code as shown below. But when the Dashboard is displayed, token SelectedDay is set to "$CurDate$" instead of current date. 

Could you please help me on this ?   

"inputs": {
"input_9ejCAUHM": {
"type": "input.text",
"options": {
"token": "SelectedDay",
"selectFirstSearchResult": true,
"defaultValue": "$CurDate$"
},
"title": "Enter Date (MM/DD/YYYY)"
}
},

 

Thanks,

Ravikumar

 

Labels (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Where is CurDate set?

0 Karma

ravikumarsri
Observer

Hi,

I searched in the Dashboard code. "CurDate" is not set anywhere in the code.

Looks like "CurDate" is kind of build in variable in Classic XML Dashboard.

 

Thanks,

Ravikumar

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

OK - I have never come across that  in SimpleXML, indeed, it doesn't seem to work for me. Whatever the case, it seems like it isn't defined for you in Studio either.

0 Karma
Get Updates on the Splunk Community!

See just what you’ve been missing | Observability tracks at Splunk University

Looking to sharpen your observability skills so you can better understand how to collect and analyze data from ...

Weezer at .conf25? Say it ain’t so!

Hello Splunkers, The countdown to .conf25 is on-and we've just turned up the volume! We're thrilled to ...

How SC4S Makes Suricata Logs Ingestion Simple

Network security monitoring has become increasingly critical for organizations of all sizes. Splunk has ...