Dashboards & Visualizations
Highlighted

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

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
Highlighted

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

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

0 Karma
Highlighted

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

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"/>
Highlighted

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

Explorer

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

0 Karma
Highlighted

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

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?




| eval message="Happy Splunking!!!"


0 Karma
Highlighted

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

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