Dashboards & Visualizations

Want to add color to table fields

Ashish0405
Path Finder

Hi Team,

I have added Red & Green color to Status column, I want to add the same to severity column as well.

Can some one suggest me some commands

 

I have used below commands to add color to status field.

 

<option name="drilldown">none</option>
<option name="refresh.display">progressbar</option>
<format type="color" field="Status">
<colorPalette type="map">{"failed":#D93F3C,"finished":#31A35F,"Critical":#D93F3C,"Informational":#31A35F}</colorPalette>
</format>

Ashish0405_0-1748253414216.png

 

Labels (1)
0 Karma
1 Solution

kiran_panchavat
SplunkTrust
SplunkTrust

@Ashish0405 

 

kiran_panchavat_0-1748263747227.pngkiran_panchavat_1-1748263763485.png

<dashboard version="1.1">
<label>Status &amp; Severity Coloring</label>
<row>
<panel>
<title>Test Status and Severity</title>
<table>
<search>
<query>
<![CDATA[
| makeresults count=4
| streamstats count as id
| eval Status=case(id==1, "failed", id==2, "finished", id==3, "finished", 1==1, "failed")
| eval Severity=case(id==1, "Critical", id==2, "Informational", id==3, "Critical", 1==1, "Informational")
]]>
</query>
</search>
<option name="drilldown">none</option>
<option name="refresh.display">progressbar</option>
<format type="color" field="Status">
<colorPalette type="map">{&quot;failed&quot;:&quot;#D93F3C&quot;,&quot;finished&quot;:&quot;#31A35F&quot;}</colorPalette>
</format>
<format type="color" field="Severity">
<colorPalette type="map">{&quot;Critical&quot;:&quot;#D93F3C&quot;,&quot;Informational&quot;:&quot;#31A35F&quot;}</colorPalette>
</format>
</table>
</panel>
</row>
</dashboard>
Did this help? If yes, please consider giving kudos, marking it as the solution, or commenting for clarification — your feedback keeps the community going!

View solution in original post

0 Karma

Ashish0405
Path Finder

Thank you that's worked

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @Ashish0405 ,

good for you, see next time!

Ciao and happy splunking

Giuseppe

P.S.: Karma Points are appreciated by all the contributors 😉

0 Karma

livehybrid
SplunkTrust
SplunkTrust

Hi @Ashish0405 

Just add another <format> under the existing one such as:

        <format type="color" field="Severity">
          <colorPalette type="map">{"Critical":#D93F3C,"Informational":#31A35F}</colorPalette>
        </format>

livehybrid_0-1748275483182.png

 

Full example:

<dashboard version="1.1">
  <label>Demo</label>
  <row>
    <panel>
      <table>
        <search>
          <query>|makeresults | eval Status="failed", Severity="Critical"
| append [makeresults | eval Status="finished", Severity="Informational"]</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
          <sampleRatio>1</sampleRatio>
        </search>
        <option name="drilldown">none</option>
        <option name="refresh.display">progressbar</option>
        <format type="color" field="Status">
          <colorPalette type="map">{"failed":#D93F3C,"finished":#31A35F,"Critical":#D93F3C,"Informational":#31A35F}</colorPalette>
        </format>
        <format type="color" field="Severity">
          <colorPalette type="map">{"Critical":#D93F3C,"Informational":#31A35F}</colorPalette>
        </format>
      </table>
    </panel>
  </row>
</dashboard>

🌟 Did this answer help you? If so, please consider:

  • Adding karma to show it was useful
  • Marking it as the solution if it resolved your issue
  • Commenting if you need any clarification

Your feedback encourages the volunteers in this community to continue contributing

Edit - Sorry just seen the other replies which I hadnt noticed before, not meaning to step on others toes! 

0 Karma

kiran_panchavat
SplunkTrust
SplunkTrust

@Ashish0405 

 

kiran_panchavat_0-1748263747227.pngkiran_panchavat_1-1748263763485.png

<dashboard version="1.1">
<label>Status &amp; Severity Coloring</label>
<row>
<panel>
<title>Test Status and Severity</title>
<table>
<search>
<query>
<![CDATA[
| makeresults count=4
| streamstats count as id
| eval Status=case(id==1, "failed", id==2, "finished", id==3, "finished", 1==1, "failed")
| eval Severity=case(id==1, "Critical", id==2, "Informational", id==3, "Critical", 1==1, "Informational")
]]>
</query>
</search>
<option name="drilldown">none</option>
<option name="refresh.display">progressbar</option>
<format type="color" field="Status">
<colorPalette type="map">{&quot;failed&quot;:&quot;#D93F3C&quot;,&quot;finished&quot;:&quot;#31A35F&quot;}</colorPalette>
</format>
<format type="color" field="Severity">
<colorPalette type="map">{&quot;Critical&quot;:&quot;#D93F3C&quot;,&quot;Informational&quot;:&quot;#31A35F&quot;}</colorPalette>
</format>
</table>
</panel>
</row>
</dashboard>
Did this help? If yes, please consider giving kudos, marking it as the solution, or commenting for clarification — your feedback keeps the community going!
0 Karma

Ashish0405
Path Finder

Thank you, that's worked

gcusello
SplunkTrust
SplunkTrust

Hi @Ashish0405 ,

you have to follow the same process.

or copy the option 

<format type="color" field="Severity">
     <colorPalette type="map"> 
 {"failed":#D93F3C,"finished":#31A35F,"Critical":#D93F3C,"Informational":#31A35F}</colorPalette>
</format>

obviously changing the values of the Severity field.

Ciao.

Giuseppe

0 Karma
Get Updates on the Splunk Community!

CX Day is Coming!

Customer Experience (CX) Day is on October 7th!! We're so excited to bring back another day full of wonderful ...

Strengthen Your Future: A Look Back at Splunk 10 Innovations and .conf25 Highlights!

The Big One: Splunk 10 is Here!  The moment many of you have been waiting for has arrived! We are thrilled to ...

Now Offering the AI Assistant Usage Dashboard in Cloud Monitoring Console

Today, we’re excited to announce the release of a brand new AI assistant usage dashboard in Cloud Monitoring ...