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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...