Dashboards & Visualizations

How to show the status of an ESXI and display panels

pduvofmr
Path Finder

Hi Community,

I would like to show the status of an ESXI via pictures.
If I displayed the search on a table then the values are shown correctly.
Why do the different panels not display?

Please advice...

<panel>
  <table>
  <search>
    <query>
      index="vmware-inv" | spath type | search type=HostSystem | spath moid | search moid="host-9" AND changeSet.summary.overallStatus!=""
      | stats latest(changeSet.summary.overallStatus) as ManagedEntityStatus by host
    </query>
    <done>
      <condition match="$result.ManagedEntityStatus$ == green">
        <set token="show_Green">true</set>
        <unset token="show_Grey"></unset>
        <unset token="show_Yellow"></unset>
              <unset token="show_Red"></unset>
      </condition>
      <condition match="$result.ManagedEntityStatus$ == red">
        <set token="show_Red">true</set>
        <unset token="show_Grey"></unset>
        <unset token="show_Yellow"></unset>
              <unset token="show_Green"></unset>
      </condition>
      <condition match="$result.ManagedEntityStatus$ == yellow">
        <set token="show_Yellow">true</set>
        <unset token="show_Grey"></unset>
        <unset token="show_Green"></unset>
              <unset token="show_Red"></unset>
      </condition>
      <condition match="$result.ManagedEntityStatus$ == grey">
        <set token="show_Grey">true</set>
        <unset token="show_Green"></unset>
        <unset token="show_Yellow"></unset>
              <unset token="show_Red"></unset>
      </condition>
    </done>
  </search>
</table>
</panel>
    <panel depends="$show_Green$">
  <html>
    <img src="http://sr.photos3.fotosearch.com/bthumb/CSP/CSP993/k14957243.jpg"></img>
  </html>
</panel>
    <panel depends="$show_Red$">
  <html>
    <img src="https://photos.gograph.com/thumbs/CSP/CSP742/k17687405.jpg"></img>
  </html>
</panel>
    <panel depends="$show_Yellow$">
  <html>
    <img src="http://www.bodyandmind.co.za/kidz/crying-baby.jpg"></img>
  </html>
</panel>
    <panel depends="$show_Grey$">
  <html>
    <img src="http://www.lindon.us/sitebuildercontent/sitebuilderpictures/Unbekannt.jpg"></img>
  </html>
</panel>
0 Karma
1 Solution

justinatpnnl
Communicator

You are REALLY close on this one. In a condition match, you need to wrap string values like "green" in quotes. The caveat is that they need to be sanitized quotes since the statement is already in quotes. It should look something like this:

<condition match="$result.ManagedEntityStatus$ == &quot;green&quot;">

Otherwise it is looking for the ManagedEntityStatus field to match another field named green

View solution in original post

Vijeta
Influencer

@pduvofmr Try using quot in condition like this <condition match=" $result.ManagedEntityStatus$ == &quot;green&quot; ">

0 Karma

justinatpnnl
Communicator

Be careful with the formatting on this one. While it is more readable, you are including the spaces in the expected value and the condition will not match because "green" is not equal to " green ".

0 Karma

Vijeta
Influencer

Yes you are right, just edited. Also saw you already answered it :). Thanks

0 Karma

justinatpnnl
Communicator

You are REALLY close on this one. In a condition match, you need to wrap string values like "green" in quotes. The caveat is that they need to be sanitized quotes since the statement is already in quotes. It should look something like this:

<condition match="$result.ManagedEntityStatus$ == &quot;green&quot;">

Otherwise it is looking for the ManagedEntityStatus field to match another field named green

Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...