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
Get Updates on the Splunk Community!

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!

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

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...