<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic What's the value of a token if is not set in an input? in Splunk Enterprise</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise/What-s-the-value-of-a-token-if-is-not-set-in-an-input/m-p/748337#M22434</link>
    <description>&lt;P&gt;Hi everyone,&lt;BR /&gt;What's the value of a token if is not set in an input? An empty string, null() or?&lt;BR /&gt;I was trying to do something like:&lt;BR /&gt;| eval user=if(isnull("$user_token$"), user, "$user_token$"), but it doesn't work.&lt;/P&gt;</description>
    <pubDate>Thu, 19 Jun 2025 13:34:02 GMT</pubDate>
    <dc:creator>AleCanzo</dc:creator>
    <dc:date>2025-06-19T13:34:02Z</dc:date>
    <item>
      <title>What's the value of a token if is not set in an input?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/What-s-the-value-of-a-token-if-is-not-set-in-an-input/m-p/748337#M22434</link>
      <description>&lt;P&gt;Hi everyone,&lt;BR /&gt;What's the value of a token if is not set in an input? An empty string, null() or?&lt;BR /&gt;I was trying to do something like:&lt;BR /&gt;| eval user=if(isnull("$user_token$"), user, "$user_token$"), but it doesn't work.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jun 2025 13:34:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/What-s-the-value-of-a-token-if-is-not-set-in-an-input/m-p/748337#M22434</guid>
      <dc:creator>AleCanzo</dc:creator>
      <dc:date>2025-06-19T13:34:02Z</dc:date>
    </item>
    <item>
      <title>Re: What's the value of a token if is not set in an input?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/What-s-the-value-of-a-token-if-is-not-set-in-an-input/m-p/748342#M22435</link>
      <description>&lt;P&gt;If a token is not set, the dashboard will wait until the token is set before proceeding to evaluate the search.&lt;/P&gt;&lt;P&gt;What is your usecase? Perhaps there may be a better way to approach this?&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jun 2025 13:57:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/What-s-the-value-of-a-token-if-is-not-set-in-an-input/m-p/748342#M22435</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2025-06-19T13:57:50Z</dc:date>
    </item>
    <item>
      <title>Re: What's the value of a token if is not set in an input?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/What-s-the-value-of-a-token-if-is-not-set-in-an-input/m-p/748346#M22436</link>
      <description>&lt;P&gt;An unset token has no value, but it is not null, either.&amp;nbsp; It's as though the token doesn't exist.&lt;/P&gt;&lt;P&gt;Splunk will not execute a query if any of the tokens within it are undefined.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jun 2025 14:01:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/What-s-the-value-of-a-token-if-is-not-set-in-an-input/m-p/748346#M22436</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2025-06-19T14:01:30Z</dc:date>
    </item>
    <item>
      <title>Re: What's the value of a token if is not set in an input?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/What-s-the-value-of-a-token-if-is-not-set-in-an-input/m-p/748358#M22438</link>
      <description>&lt;P&gt;When you are playing with tokens in SXML, you should install this app&amp;nbsp;&lt;A href="https://classic.splunkbase.splunk.com/app/1603/" target="_blank"&gt;https://classic.splunkbase.splunk.com/app/1603/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Then add this into your forms.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;form version="1.1" theme="light" script="simple_xml_examples:showtokens.js"&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;After this it shows all tokens what you have and what are their values like&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="isoutamo_0-1750343208310.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/39420i3F9A211336F87E67/image-size/medium?v=v2&amp;amp;px=400" role="button" title="isoutamo_0-1750343208310.png" alt="isoutamo_0-1750343208310.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;When I add ip, but didn't press submit&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="isoutamo_1-1750343253792.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/39421iC27563D6825BDBEE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="isoutamo_1-1750343253792.png" alt="isoutamo_1-1750343253792.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="isoutamo_2-1750343273087.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/39422i19C9CAC4E37921D1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="isoutamo_2-1750343273087.png" alt="isoutamo_2-1750343273087.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;After submit is pressed.&lt;/P&gt;&lt;P&gt;&lt;A href="https://data-findings.com/wp-content/uploads/2024/09/HSUG-20240903-Tiia-Ojares.pdf" target="_blank"&gt;https://data-findings.com/wp-content/uploads/2024/09/HSUG-20240903-Tiia-Ojares.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jun 2025 14:28:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/What-s-the-value-of-a-token-if-is-not-set-in-an-input/m-p/748358#M22438</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2025-06-19T14:28:53Z</dc:date>
    </item>
    <item>
      <title>Re: What's the value of a token if is not set in an input?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/What-s-the-value-of-a-token-if-is-not-set-in-an-input/m-p/748366#M22439</link>
      <description>&lt;P&gt;The other thing you can do without installing an app is to go into the xml and create an html tag&lt;BR /&gt;&lt;BR /&gt;&amp;lt;row&amp;gt;&lt;BR /&gt;&amp;lt;html&amp;gt;&lt;BR /&gt;Value of token1 = $token1$&lt;BR /&gt;Value of token2 = $otken2$&lt;BR /&gt;&amp;lt;/html&amp;gt;&lt;BR /&gt;&amp;lt;/row&amp;gt;&lt;BR /&gt;&lt;BR /&gt;I may have shorthanded the html tags, but basically everytime the token changes the token value will be displayed in that html tag.&amp;nbsp; Really easy way to keep track of the token value.&amp;nbsp; If you need a default token value look into using the &amp;lt;set&amp;gt; function in tokens.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;But&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt; was spot on when he said that when a token is not set it is neither empty nor null.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jun 2025 17:11:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/What-s-the-value-of-a-token-if-is-not-set-in-an-input/m-p/748366#M22439</guid>
      <dc:creator>moorte</dc:creator>
      <dc:date>2025-06-19T17:11:58Z</dc:date>
    </item>
    <item>
      <title>Re: What's the value of a token if is not set in an input?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/What-s-the-value-of-a-token-if-is-not-set-in-an-input/m-p/748368#M22441</link>
      <description>No need to use html tags. You could add those into title etc. But when you have lot of those and you will set and unset those based on buttons, clicks etc. then this approach doesn’t work anymore.</description>
      <pubDate>Thu, 19 Jun 2025 17:34:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/What-s-the-value-of-a-token-if-is-not-set-in-an-input/m-p/748368#M22441</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2025-06-19T17:34:14Z</dc:date>
    </item>
    <item>
      <title>Re: What's the value of a token if is not set in an input?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/What-s-the-value-of-a-token-if-is-not-set-in-an-input/m-p/748382#M22442</link>
      <description>&lt;P&gt;No app necessary and doesn't need javascript.&amp;nbsp; Works on a post.&amp;nbsp; This is the way to go.&amp;nbsp; Using an app is not a bad method, but sometimes you have to go through a change control board or you use splunk cloud.&amp;nbsp; Using an HTML Tag will work as long as you have edit rights to the dashboard, which you should if you are coding the dashboard.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jun 2025 23:47:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/What-s-the-value-of-a-token-if-is-not-set-in-an-input/m-p/748382#M22442</guid>
      <dc:creator>LAME-Creations</dc:creator>
      <dc:date>2025-06-19T23:47:12Z</dc:date>
    </item>
    <item>
      <title>Re: What's the value of a token if is not set in an input?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/What-s-the-value-of-a-token-if-is-not-set-in-an-input/m-p/748383#M22443</link>
      <description>&lt;P&gt;The following youtube video shows this tactic&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.youtube.com/watch?v=Z-OPVR61bJY" target="_blank"&gt;Master Splunk Dashboards: Expert Guide to Troubleshooting Tokens!&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;it is at about the 7 minute mark of the video.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&amp;lt;row&amp;gt;&lt;BR /&gt;&amp;lt;panel&amp;gt;&lt;BR /&gt;&amp;lt;html&amp;gt;&lt;BR /&gt;your code&lt;BR /&gt;&amp;lt;/html&amp;gt;&lt;BR /&gt;&amp;lt;/panel&amp;gt;&lt;BR /&gt;&amp;lt;/row&amp;gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jun 2025 23:49:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/What-s-the-value-of-a-token-if-is-not-set-in-an-input/m-p/748383#M22443</guid>
      <dc:creator>LAME-Creations</dc:creator>
      <dc:date>2025-06-19T23:49:39Z</dc:date>
    </item>
    <item>
      <title>Re: What's the value of a token if is not set in an input?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/What-s-the-value-of-a-token-if-is-not-set-in-an-input/m-p/748385#M22445</link>
      <description>&lt;P&gt;As&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;points out, the token has no value so your search won't run at all to get to that point.&lt;/P&gt;&lt;P&gt;If you want to always have a token so you search will run, you should set the default for the token to something, even if it's just the empty string, i.e. &lt;STRONG&gt;&amp;lt;default&amp;gt;&amp;lt;/default&amp;gt;&amp;nbsp;&lt;/STRONG&gt;but then your SPL would be&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval user=if(len($user_token|s$)=0, user, $user_token|s$)&lt;/LI-CODE&gt;&lt;P&gt;i.e. it checks for length of 0 in the&amp;nbsp; input. Note the use of &lt;STRONG&gt;$user_token|s$&lt;/STRONG&gt;, i.e. with a &lt;STRONG&gt;|s&lt;/STRONG&gt; before the final $ sign which effectively quotes the token.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jun 2025 04:01:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/What-s-the-value-of-a-token-if-is-not-set-in-an-input/m-p/748385#M22445</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2025-06-20T04:01:12Z</dc:date>
    </item>
  </channel>
</rss>

