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!

Fall Into Learning with New Splunk Education Courses

Every month, Splunk Education releases new courses to help you branch out, strengthen your data science roots, ...

Super Optimize your Splunk Stats Searches: Unlocking the Power of tstats, TERM, and ...

By Martin Hettervik, Senior Consultant and Team Leader at Accelerate at Iver, Splunk MVPThe stats command is ...

How Splunk Observability Cloud Prevented a Major Payment Crisis in Minutes

Your bank's payment processing system is humming along during a busy afternoon, handling millions in hourly ...