Dashboards & Visualizations

help on token count

jip31
Motivator

hi
In the search below, I am doing a count on 2 token : NbIndHost NbHostProcessSup80

 `CPU` 
| stats dc(host) as NbHostProcessSup80 
| appendcols 
[| inputlookup host.csv |
| stats dc(host) as NbIndHost] 
| eval Perc=round((NbHostProcessSup80/NbIndHost)*100,2) 
| table Perc, NbIndHost NbHostProcessSup80

In my xml, I have added <option name="underLabel">/ $NbIndHost$ machines</option> in order to display the NbIndHost count in my single panel
Now I also want to add the NbHostProcessSup80 count
I am doing <option name="underLabel">$NbHostProcessSup80/ $NbIndHost$ machines</option> but it doesnt works
what is the problem please??

Tags (1)
0 Karma
1 Solution

vnravikumar
Champion

Hi

Try like

<dashboard>
  <label>singlevalue</label>
  <row>
    <panel>
      <single>
        <search>
          <query>....your query</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
          <done>
            <condition>
              <set token="NbHostProcessSup80">$result.NbHostProcessSup80$</set>
              <set token="NbIndHost">$result.NbIndHost$</set>
            </condition>
          </done>
        </search>
        <option name="drilldown">none</option>
        <option name="underLabel">$NbHostProcessSup80$/$NbIndHost$ machine</option>
      </single>
    </panel>
  </row>
</dashboard>

View solution in original post

0 Karma

vnravikumar
Champion

Hi

Try like

<dashboard>
  <label>singlevalue</label>
  <row>
    <panel>
      <single>
        <search>
          <query>....your query</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
          <done>
            <condition>
              <set token="NbHostProcessSup80">$result.NbHostProcessSup80$</set>
              <set token="NbIndHost">$result.NbIndHost$</set>
            </condition>
          </done>
        </search>
        <option name="drilldown">none</option>
        <option name="underLabel">$NbHostProcessSup80$/$NbIndHost$ machine</option>
      </single>
    </panel>
  </row>
</dashboard>
0 Karma

jip31
Motivator

Hi perfect thanks!

0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

@jip31

Can you please share single view XML?

0 Karma
Get Updates on the Splunk Community!

.conf25 Community Recap

Hello Splunkers, And just like that, .conf25 is in the books! What an incredible few days — full of learning, ...

Splunk App Developers | .conf25 Recap & What’s Next

If you stopped by the Builder Bar at .conf25 this year, thank you! The retro tech beer garden vibes were ...

Congratulations to the 2025-2026 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...