Dashboards & Visualizations

How to remove a token name when the token has no value?

morethanyell
Builder

We're working on an HTML table with <td> that displays value of token (such that <td>$token1$</td>). We don't know how to remove the token name $token1$ when we deselect from the inputfield. Here's a clearer picture:

alt text

But when we deselect, the token name appears! How do we solve this?

alt text

Thanks in advance!

0 Karma
1 Solution

niketn
Legend

@morethanyell please add the following change event handler to your Dropdown input and test.

  <change>
    <condition match="isnull($value$)">
      <set token="token1"></set>
      <set token="token2"></set>          
    </condition>
    <condition>
      <set token="token1">$label$</set>
      <set token="token2">$value$</set>
    </condition>
  </change>
____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

View solution in original post

niketn
Legend

@morethanyell please add the following change event handler to your Dropdown input and test.

  <change>
    <condition match="isnull($value$)">
      <set token="token1"></set>
      <set token="token2"></set>          
    </condition>
    <condition>
      <set token="token1">$label$</set>
      <set token="token2">$value$</set>
    </condition>
  </change>
____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

bgennerm
Engager

you can even do this with the same token:



if(isnull($value$),"blank or other text", $token1$)


harishalipaka
Motivator

hi @morethanyell

If you want to blank that cell when it has no value ,dynamically add blank for token value when it is null.

Thanks
Harish

morethanyell
Builder

how is this done? sorry i'm new.

0 Karma
Get Updates on the Splunk Community!

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

 Prepare to elevate your security operations with the powerful upgrade to Splunk Enterprise Security 8.x! This ...

Get Early Access to AI Playbook Authoring: Apply for the Alpha Private Preview ...

Passionate about security automation? Apply now to our AI Playbook Authoring Alpha private preview ...

Reduce and Transform Your Firewall Data with Splunk Data Management

Managing high-volume firewall data has always been a challenge. Noisy events and verbose traffic logs often ...