Dashboards & Visualizations

Change background of single value based on its text

allan_newton
Path Finder

Dear Saviours,

I have multiple single-value elements which have three possible values (Passed, Failed, Executed). Now my single value background has to turn green if the value is "Passed", red if the value is "Failed" and grey if the value is "Executed".

I know i can achieve this with range maps, but I want to retain the text in the final view.

0 Karma
1 Solution

sundareshr
Legend

See if this helps

https://answers.splunk.com/answers/103239/change-color-of-single-value-visualization.html

*UPDATED*

    <dashboard>
      <row>
        <panel>
          <single>
            <search>
              <query>| makeresults | eval state="Failed" | table state | eval severity=case(state="Passed", 0, state="Failed", 10, state="Executed", 5) | rangemap field=severity low=0-4 elevated=4-6 default=severe</query>
              <earliest>-15m</earliest>
              <latest>now</latest>
            </search>
            <option name="colorBy">value</option>
            <option name="colorMode">block</option>
            <option name="useColors">0</option>
            <option name="useThousandSeparators">1</option>
            <option name="classField">severity</option>
            <option name="field">state</option>
          </single>
        </panel>
      </row>
    </dashboard>

View solution in original post

sundareshr
Legend

See if this helps

https://answers.splunk.com/answers/103239/change-color-of-single-value-visualization.html

*UPDATED*

    <dashboard>
      <row>
        <panel>
          <single>
            <search>
              <query>| makeresults | eval state="Failed" | table state | eval severity=case(state="Passed", 0, state="Failed", 10, state="Executed", 5) | rangemap field=severity low=0-4 elevated=4-6 default=severe</query>
              <earliest>-15m</earliest>
              <latest>now</latest>
            </search>
            <option name="colorBy">value</option>
            <option name="colorMode">block</option>
            <option name="useColors">0</option>
            <option name="useThousandSeparators">1</option>
            <option name="classField">severity</option>
            <option name="field">state</option>
          </single>
        </panel>
      </row>
    </dashboard>

allan_newton
Path Finder

Thanks much Sundareshr! You saved my day.

0 Karma

allan_newton
Path Finder

I have already seen this. If your help is not a direct/targeted one to the question, others would assume the question is answered. 😞

0 Karma

sundareshr
Legend

Try update ans

0 Karma
Get Updates on the Splunk Community!

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...