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
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!

Network to App: Observability Unlocked [May & June Series]

In today’s digital landscape, your environment is no longer confined to the data center. It spans complex ...

SPL2 Deep Dives, AppDynamics Integrations, SAML Made Simple and Much More on Splunk ...

Splunk Lantern is Splunk’s customer success center that provides practical guidance from Splunk experts on key ...

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

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