Splunk Search

How to change colors in a table?

shruthiangadi
Explorer

Hi ,

I have a statistics table in which each column contains different value for eg:

Application Name Application ID Functional Fitness Digital Fitness
A 123 0.2 0.5
B 456 3 5
C 789 1 1.5

So now i want to change the color of the value present in functional fitness and digital fitness based on the range, if the range is from 0 to 0.5 -- green colour, 0.6 to 3 --- red colour, 3.5 to 5 --- yellow colour

So can you please help me in changing the colour of the value present in each column based on the range.

Tags (2)
0 Karma

to4kawa
Ultra Champion

table color

hi, how about this

0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

Yes @to4kawa , this is the same what I said. LOL 😛

0 Karma

to4kawa
Ultra Champion

wow, That's right 🙂
just in case,

yellow #ffff00
red #ff0000
green #00ff00
0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

@shruthiangadi

You can format table cell. Refer : https://docs.splunk.com/Documentation/Splunk/7.3.1/Viz/TableFormatsXML#Table_format_source_code_exam...

Here is sample dashboard.

<dashboard>
  <label>Table Cell Color</label>
  <row>
    <panel>
      <table>
        <search>
          <query>| makeresults 
| eval _raw="
Application_Name,Application_ID,Functional_Fitness,Digital_Fitness
A,123,0.2,0.5
B,456,3,5
C,789,1,1.5" | multikv forceheader=1 | table Application_Name,Application_ID,Functional_Fitness,Digital_Fitness</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
          <sampleRatio>1</sampleRatio>
        </search>
        <option name="count">20</option>
        <option name="dataOverlayMode">none</option>
        <option name="drilldown">none</option>
        <option name="percentagesRow">false</option>
        <option name="rowNumbers">false</option>
        <option name="totalsRow">false</option>
        <option name="wrap">true</option>
        <format type="color" field="Functional_Fitness">
          <colorPalette type="list">[#53A051,#DC4E41,#F8BE34]</colorPalette>
          <scale type="threshold">0.6,3.5</scale>
        </format>
        <format type="color" field="Digital_Fitness">
          <colorPalette type="list">[#53A051,#DC4E41,#F8BE34]</colorPalette>
          <scale type="threshold">0.6,3.5</scale>
        </format>
      </table>
    </panel>
  </row>
</dashboard>
0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

What Is Splunk? Here’s What You Can Do with Splunk

Hey Splunk Community, we know you know Splunk. You likely leverage its unparalleled ability to ingest, index, ...

Level Up Your .conf25: Splunk Arcade Comes to Boston

With .conf25 right around the corner in Boston, there’s a lot to look forward to — inspiring keynotes, ...

Manual Instrumentation with Splunk Observability Cloud: How to Instrument Frontend ...

Although it might seem daunting, as we’ve seen in this series, manual instrumentation can be straightforward ...