Dashboards & Visualizations

How to set default token value to null or empty in dashboard xml.

splunkazureteam
New Member

i have one dashboard that consist two tokens, one token having name "resources" and another "WebWorkerInstanceName". i am able to set value of "resources" token that is populating from table where as "WebWorkerInstanceName" token need default value that should be empty but i am not able to assign empty value to "WebWorkerInstanceName" token.

Both tokens are further used in search string that are not accepting the empty value. i am not able to assign the (null or empty) value as default value to "WebWorkerInstance" token because it is showing (null or empty) as string in search string. Below is my code for the same.

      <!-- Use set to specify the new token to be created.
       Use any token from the page or from the click event to produce the value needed. -->
      <set token="Resources">$row.Resources$</set>
      <!-- If we also set the form.sourcetype the input will get updated too -->
      <set token="form.Resources">$row.Resources$</set>      

     <!-- Use set to specify the new token to be created.
      Use any token from the page or from the click event to produce the value needed. -->
      <set token="WebWorkerInstanceName"></set>
      <!-- If we also set the form.sourcetype the input will get updated too -->
      <set token="form.WebWorkerInstanceName"></set>

Please guide me about the default value to be (null or empty) for any token which can be accepted by search string.

Thanks
Avikash

Tags (3)
0 Karma

suchakrajan
New Member

@splunkazureteam, kindly check if answer of the following question helps.

https://answers.splunk.com/answers/594322/how-to-use-multiple-text-tokens-even-with-no-value.html

0 Karma

splunklakshman
Explorer

Dear Folks, Please help with code. I am facing this issue now. Pls Pls Pls

0 Karma

niketn
Legend

@splunklakshman... can you please explain your issue? unset token should set the token to null as stated by @somesoni2 above? Could you specify your scenario, if possible through a separate Splunk question if unset token does not solve your needs?

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

vasanthmss
Motivator

Hi Splunk Azure Team,

I am not sure in earlier versions, but Token unset has been introduced in 6.2 details available in this Link

Cheers!

Vasu

V
0 Karma

somesoni2
SplunkTrust
SplunkTrust

Unset option is available since 6.1 and you can just change set to unset to set it to null value.

 <!-- Use set to specify the new token to be created.
Use any token from the page or from the click event to produce the value needed. -->
<unset token="WebWorkerInstanceName"/>
<!-- If we also set the form.sourcetype the input will get updated too -->
<unset token="form.WebWorkerInstanceName"/>
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...