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!

What the End of Support for Splunk Add-on Builder Means for You

Hello Splunk Community! We want to share an important update regarding the future of the Splunk Add-on Builder ...

Solve, Learn, Repeat: New Puzzle Channel Now Live

Welcome to the Splunk Puzzle PlaygroundIf you are anything like me, you love to solve problems, and what ...

Building Reliable Asset and Identity Frameworks in Splunk ES

 Accurate asset and identity resolution is the backbone of security operations. Without it, alerts are ...