Splunk Search

How to change colors in a table?

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

SplunkTrust
SplunkTrust

table color

hi, how about this

0 Karma

SplunkTrust
SplunkTrust

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

0 Karma

SplunkTrust
SplunkTrust

wow, That's right 🙂
just in case,

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

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