Dashboards & Visualizations

How to change the color of a whole panel based on a single value result in Splunk 6.2.1?

kpsg25690
Engager

Hello,

I'm creating a dashboard using Splunk 6.2.1 which will have multiple single value panels, each with a value of YES or NO and a drilldown to a different dashboard.

I am able to change the text color using the "severe" and "low" default classes and also the background color using the same, but I want to change the background of the whole panel instead of the single value component.

My xml is:

<dashboard script="hc.js" stylesheet="hc.css">
  <label>Health_Check_Dashboard</label>
  <row>
    <panel>
      <single id="one">
        <title>1 Status</title>
        <search>
          <query>index=event* sourcetype=<sourcetype> CellName=<name> | head 1| eval result=if(PrimaryRunning=="NO" OR SecondaryRunning=="NO","NO","YES") | eval class=if(PrimaryRunning=="NO" OR SecondaryRunning=="NO","severe","low") | table result,class</query>
          <earliest>0</earliest>
          <latest></latest>
        </search>
        <option name="classField">class</option>
        <option name="drilldown">none</option>
        <option name="useColors">1</option>
      </single>
    </panel>
    <panel>
        <single id="two">
        <title>2 Status</title>
        <search>
          <query>index=event* sourcetype=<sourcetype> CellName=<name> | head 1| eval result=if(PrimaryRunning=="NO" OR SecondaryRunning=="NO","NO","YES") | eval class=if(PrimaryRunning=="NO" OR SecondaryRunning=="NO","severe","low") | table result,class</query>
          <earliest>0</earliest>
          <latest></latest>
        </search>
        <option name="classField">class</option>
        <option name="drilldown">none</option>
        <option name="useColors">1</option>
      </single>
    </panel>
    <panel>
      <single id="three">
        <title>3 Status</title>
        <search>
          <query>index=event* sourcetype=<sourcetype> CellName=<name> | head 1| eval result=if(PrimaryRunning=="NO" OR SecondaryRunning=="NO","NO","YES") | eval class=if(PrimaryRunning=="NO" OR SecondaryRunning=="NO","severe","low") | table result,class</query>
          <earliest>0</earliest>
          <latest></latest>
        </search>
        <option name="classField">class</option>
        <option name="drilldown">none</option>
        <option name="useColors">1</option>
      </single>
    </panel>
  </row>
  </dashboard>

I've gone through the other examples in here and the dashboard examples and couldn't find anything that works.

Any help would be appreciated.

Thanks!

0 Karma

jnichols914
Explorer

I don't know if you figured this out already, but you want to use the following as an option "Block". When you do this, your background will change based on the colors you specified and your text will stay white.

Hope this helps,

Justin

<option name="colorBy">value</option>
 <option name="colorMode">block</option>
0 Karma
.conf21 Now Fully Virtual!
Register for FREE Today!

We've made .conf21 totally virtual and totally FREE! Our completely online experience will run from 10/19 through 10/20 with some additional events, too!