<?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 Why is my very simple dashboard token condition not working? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-my-very-simple-dashboard-token-condition-not-working/m-p/478393#M31386</link>
    <description>&lt;P&gt;I can't seem to set/unset a token based on whether some search result is equal or not to 1.&lt;/P&gt;

&lt;P&gt;Can anybody point out why this doesn't work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
  &amp;lt;label&amp;gt;TEMP Endpoint Processes Clone&amp;lt;/label&amp;gt;
  &amp;lt;fieldset submitButton="true" autoRun="false"&amp;gt;
    &amp;lt;input type="text" token="number" searchWhenChanged="false"&amp;gt;
      &amp;lt;label&amp;gt;Host count&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;100&amp;lt;/default&amp;gt;
      &amp;lt;initialValue&amp;gt;100&amp;lt;/initialValue&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;html&amp;gt;
      &amp;lt;p&amp;gt;host_count=$host_count$&amp;lt;/p&amp;gt;
      &amp;lt;p&amp;gt;host_count1 is 1=$host_count1$&amp;lt;/p&amp;gt;
      &amp;lt;p&amp;gt;host_count2 catchall=$host_count2$&amp;lt;/p&amp;gt;
      &amp;lt;p&amp;gt;gotuniquehost=$gotuniquehost$&amp;lt;/p&amp;gt;
    &amp;lt;/html&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;done&amp;gt;
            &amp;lt;condition match="$result.host_count$ == 1"&amp;gt;
              &amp;lt;set token="gotuniquehost"&amp;gt;True&amp;lt;/set&amp;gt;
              &amp;lt;set token="host_count"&amp;gt;$result.host_count$&amp;lt;/set&amp;gt;
              &amp;lt;set token="host_count1"&amp;gt;$result.host_count$&amp;lt;/set&amp;gt;
            &amp;lt;/condition&amp;gt;
            &amp;lt;condition&amp;gt;
              &amp;lt;unset token="gotuniquehost"&amp;gt;&amp;lt;/unset&amp;gt;
              &amp;lt;set token="host_count"&amp;gt;$result.host_count$&amp;lt;/set&amp;gt;
              &amp;lt;set token="host_count2"&amp;gt;$result.host_count$&amp;lt;/set&amp;gt;
            &amp;lt;/condition&amp;gt;
          &amp;lt;/done&amp;gt;
          &amp;lt;query&amp;gt;|stats count as host_count | eval host_count=$number$&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;$earliest$&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;$latest$&amp;lt;/latest&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And yet this is working:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
  &amp;lt;label&amp;gt;TEMP Endpoint Processes Clone&amp;lt;/label&amp;gt;
  &amp;lt;fieldset submitButton="true" autoRun="false"&amp;gt;
    &amp;lt;input type="text" token="number" searchWhenChanged="false"&amp;gt;
      &amp;lt;label&amp;gt;Host count&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;100&amp;lt;/default&amp;gt;
      &amp;lt;initialValue&amp;gt;100&amp;lt;/initialValue&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;html&amp;gt;
      &amp;lt;p&amp;gt;host_count=$host_count$&amp;lt;/p&amp;gt;
      &amp;lt;p&amp;gt;host_count1 gt 1=$host_count1$&amp;lt;/p&amp;gt;
      &amp;lt;p&amp;gt;host_count2 lt 1=$host_count2$&amp;lt;/p&amp;gt;
      &amp;lt;p&amp;gt;host_count3 catchall=$host_count2$&amp;lt;/p&amp;gt;
      &amp;lt;p&amp;gt;gotuniquehost=$gotuniquehost$&amp;lt;/p&amp;gt;
    &amp;lt;/html&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;done&amp;gt;
            &amp;lt;condition match="$result.host_count$ &amp;amp;gt; 1"&amp;gt;
              &amp;lt;unset token="gotuniquehost"&amp;gt;&amp;lt;/unset&amp;gt;
              &amp;lt;set token="host_count"&amp;gt;$result.host_count$&amp;lt;/set&amp;gt;
              &amp;lt;set token="host_count1"&amp;gt;$result.host_count$&amp;lt;/set&amp;gt;
            &amp;lt;/condition&amp;gt;
            &amp;lt;condition match="$result.host_count$ &amp;amp;lt; 1"&amp;gt;
              &amp;lt;unset token="gotuniquehost"&amp;gt;&amp;lt;/unset&amp;gt;
              &amp;lt;set token="host_count"&amp;gt;$result.host_count$&amp;lt;/set&amp;gt;
              &amp;lt;set token="host_count2"&amp;gt;$result.host_count$&amp;lt;/set&amp;gt;
            &amp;lt;/condition&amp;gt;
            &amp;lt;condition&amp;gt;
              &amp;lt;set token="gotuniquehost"&amp;gt;True&amp;lt;/set&amp;gt;
              &amp;lt;set token="host_count"&amp;gt;$result.host_count$&amp;lt;/set&amp;gt;
              &amp;lt;set token="host_count3"&amp;gt;$result.host_count$&amp;lt;/set&amp;gt;
            &amp;lt;/condition&amp;gt;
          &amp;lt;/done&amp;gt;
          &amp;lt;query&amp;gt;|stats count as host_count | eval host_count=$number$&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;$earliest$&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;$latest$&amp;lt;/latest&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I run splunk enterprise 7.3.3. This seems to be a bug.&lt;/P&gt;</description>
    <pubDate>Mon, 24 Feb 2020 11:57:40 GMT</pubDate>
    <dc:creator>gabriel_vasseur</dc:creator>
    <dc:date>2020-02-24T11:57:40Z</dc:date>
    <item>
      <title>Why is my very simple dashboard token condition not working?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-my-very-simple-dashboard-token-condition-not-working/m-p/478393#M31386</link>
      <description>&lt;P&gt;I can't seem to set/unset a token based on whether some search result is equal or not to 1.&lt;/P&gt;

&lt;P&gt;Can anybody point out why this doesn't work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
  &amp;lt;label&amp;gt;TEMP Endpoint Processes Clone&amp;lt;/label&amp;gt;
  &amp;lt;fieldset submitButton="true" autoRun="false"&amp;gt;
    &amp;lt;input type="text" token="number" searchWhenChanged="false"&amp;gt;
      &amp;lt;label&amp;gt;Host count&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;100&amp;lt;/default&amp;gt;
      &amp;lt;initialValue&amp;gt;100&amp;lt;/initialValue&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;html&amp;gt;
      &amp;lt;p&amp;gt;host_count=$host_count$&amp;lt;/p&amp;gt;
      &amp;lt;p&amp;gt;host_count1 is 1=$host_count1$&amp;lt;/p&amp;gt;
      &amp;lt;p&amp;gt;host_count2 catchall=$host_count2$&amp;lt;/p&amp;gt;
      &amp;lt;p&amp;gt;gotuniquehost=$gotuniquehost$&amp;lt;/p&amp;gt;
    &amp;lt;/html&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;done&amp;gt;
            &amp;lt;condition match="$result.host_count$ == 1"&amp;gt;
              &amp;lt;set token="gotuniquehost"&amp;gt;True&amp;lt;/set&amp;gt;
              &amp;lt;set token="host_count"&amp;gt;$result.host_count$&amp;lt;/set&amp;gt;
              &amp;lt;set token="host_count1"&amp;gt;$result.host_count$&amp;lt;/set&amp;gt;
            &amp;lt;/condition&amp;gt;
            &amp;lt;condition&amp;gt;
              &amp;lt;unset token="gotuniquehost"&amp;gt;&amp;lt;/unset&amp;gt;
              &amp;lt;set token="host_count"&amp;gt;$result.host_count$&amp;lt;/set&amp;gt;
              &amp;lt;set token="host_count2"&amp;gt;$result.host_count$&amp;lt;/set&amp;gt;
            &amp;lt;/condition&amp;gt;
          &amp;lt;/done&amp;gt;
          &amp;lt;query&amp;gt;|stats count as host_count | eval host_count=$number$&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;$earliest$&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;$latest$&amp;lt;/latest&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And yet this is working:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
  &amp;lt;label&amp;gt;TEMP Endpoint Processes Clone&amp;lt;/label&amp;gt;
  &amp;lt;fieldset submitButton="true" autoRun="false"&amp;gt;
    &amp;lt;input type="text" token="number" searchWhenChanged="false"&amp;gt;
      &amp;lt;label&amp;gt;Host count&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;100&amp;lt;/default&amp;gt;
      &amp;lt;initialValue&amp;gt;100&amp;lt;/initialValue&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;html&amp;gt;
      &amp;lt;p&amp;gt;host_count=$host_count$&amp;lt;/p&amp;gt;
      &amp;lt;p&amp;gt;host_count1 gt 1=$host_count1$&amp;lt;/p&amp;gt;
      &amp;lt;p&amp;gt;host_count2 lt 1=$host_count2$&amp;lt;/p&amp;gt;
      &amp;lt;p&amp;gt;host_count3 catchall=$host_count2$&amp;lt;/p&amp;gt;
      &amp;lt;p&amp;gt;gotuniquehost=$gotuniquehost$&amp;lt;/p&amp;gt;
    &amp;lt;/html&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;done&amp;gt;
            &amp;lt;condition match="$result.host_count$ &amp;amp;gt; 1"&amp;gt;
              &amp;lt;unset token="gotuniquehost"&amp;gt;&amp;lt;/unset&amp;gt;
              &amp;lt;set token="host_count"&amp;gt;$result.host_count$&amp;lt;/set&amp;gt;
              &amp;lt;set token="host_count1"&amp;gt;$result.host_count$&amp;lt;/set&amp;gt;
            &amp;lt;/condition&amp;gt;
            &amp;lt;condition match="$result.host_count$ &amp;amp;lt; 1"&amp;gt;
              &amp;lt;unset token="gotuniquehost"&amp;gt;&amp;lt;/unset&amp;gt;
              &amp;lt;set token="host_count"&amp;gt;$result.host_count$&amp;lt;/set&amp;gt;
              &amp;lt;set token="host_count2"&amp;gt;$result.host_count$&amp;lt;/set&amp;gt;
            &amp;lt;/condition&amp;gt;
            &amp;lt;condition&amp;gt;
              &amp;lt;set token="gotuniquehost"&amp;gt;True&amp;lt;/set&amp;gt;
              &amp;lt;set token="host_count"&amp;gt;$result.host_count$&amp;lt;/set&amp;gt;
              &amp;lt;set token="host_count3"&amp;gt;$result.host_count$&amp;lt;/set&amp;gt;
            &amp;lt;/condition&amp;gt;
          &amp;lt;/done&amp;gt;
          &amp;lt;query&amp;gt;|stats count as host_count | eval host_count=$number$&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;$earliest$&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;$latest$&amp;lt;/latest&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I run splunk enterprise 7.3.3. This seems to be a bug.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Feb 2020 11:57:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-my-very-simple-dashboard-token-condition-not-working/m-p/478393#M31386</guid>
      <dc:creator>gabriel_vasseur</dc:creator>
      <dc:date>2020-02-24T11:57:40Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my very simple dashboard token condition not working?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-my-very-simple-dashboard-token-condition-not-working/m-p/478394#M31387</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;Check this condition &lt;CODE&gt;&amp;lt;condition match="$result.host_count$ == &amp;amp;quot;1&amp;amp;quot;"&amp;gt;&lt;/CODE&gt; it seems you are getting &lt;CODE&gt;result.host_count&lt;/CODE&gt; as string.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Feb 2020 12:49:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-my-very-simple-dashboard-token-condition-not-working/m-p/478394#M31387</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2020-02-24T12:49:17Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my very simple dashboard token condition not working?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-my-very-simple-dashboard-token-condition-not-working/m-p/478395#M31388</link>
      <description>&lt;P&gt;Thanks, that works!&lt;/P&gt;</description>
      <pubDate>Mon, 24 Feb 2020 13:47:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-my-very-simple-dashboard-token-condition-not-working/m-p/478395#M31388</guid>
      <dc:creator>gabriel_vasseur</dc:creator>
      <dc:date>2020-02-24T13:47:47Z</dc:date>
    </item>
  </channel>
</rss>

