Dashboards & Visualizations

How to color fields based field value and Blank value

UMDTERPS
Communicator

Hi! 😃

First Question - I'm having a little trouble with my XML that is trying to color a field based on value and blank value. I have a field called "Status" that has a date in this format "3/24/2020" and if it doesn't have a date, it's blank.  If the field has a date the field will be green, if the field is blank it will be colored grey.

My current XML is as follows:

<format type="color" field="Status">
<colorPalette type="expression">if (like(value,""),"#00b33c","#A9A9A9")</colorPalette>

 

The above XML half works, it colors in the fields with dates Green, but the fields that are blank it leaves white as normal and doesn't give the grey color. 

Any ideas how to solve this with simple XML?

 

Second Question - Is it possible to color a specific cell a color using simple XML?

Labels (2)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

Are they blank (present with nothing in) or null (not present). Try something like

<format type="color" field="Status">
<colorPalette type="expression">if (isnotnull(value),"#A9A9A9","#00b33c")</colorPalette>

 

View solution in original post

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Are they blank (present with nothing in) or null (not present). Try something like

<format type="color" field="Status">
<colorPalette type="expression">if (isnotnull(value),"#A9A9A9","#00b33c")</colorPalette>

 

0 Karma

UMDTERPS
Communicator

Looks like if you flip the color scheme it works:

 

<colorPalette type="expression">if (isnotnull(value),"#00b33c","#A9A9A9")</colorPalette>
0 Karma
Get Updates on the Splunk Community!

Dashboards: Hiding charts while search is being executed and other uses for tokens

There are a couple of features of SimpleXML / Classic dashboards that can be used to enhance the user ...

Splunk Observability Cloud's AI Assistant in Action Series: Explaining Metrics and ...

This is the fourth post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how ...

Brains, Bytes, and Boston: Learn from the Best at .conf25

When you think of Boston, you might picture colonial charm, world-class universities, or even the crack of a ...