Dashboards & Visualizations

Why does ColorPalette conditional shows in edit mode but not show in preview?

Bizzaro_Shake
Explorer

Below is a colorpalette expression I have in my classic dashboard:

<format type="color" field="Present">
<colorPalette type="expression">
if(value &gt; $90PercentThreshold$, "#f50d0d", "#43e40a") <green and red, respectively>
</colorPalette>
</format>

My query is:

"<sourceString>"
"Checking <directory>*"
| rex field=_raw "InputObject\";\s+value=\"Checking (?&lt;Directory&gt;[^\"]+) Max allowed:\s+(?&lt;Max_Allowed&gt;\d+).*Files present:\s+(?&lt;Present&gt;\d+)"
| dedup Directory
| eval 50PercentThreshold = Max_Allowed * 0.5
| eval 90PercentThreshold = Max_Allowed * 0.9
| table _time, Directory, Present, Max_Allowed
| sort - Present

This is getting a file count across several directories as well as the maximum allowed files in that directory (all within the log)\. My issue is that I can see the cells in the table colored during edit mode, but when I switch to preview, the colors are not present any longer (no color exists).

Additionally, is there a way to express multiple conditionals for the colorpalette? An example would be the following, but I must have the wrong syntax:


<format type="color" field="Present">
<colorPalette type="expression">
if(value &gt; $90PercentThreshold$, "#f50d0d",
if(value &gt; $50PercentThreshold$ AND value &lt; $90PercentThreshold$, "#f2bb11", "#43e40a"))
</colorPalette>
</format>

Thanks in advance!

 

Labels (2)
Tags (1)
0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Data Persistence in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. What happens if the OpenTelemetry collector ...

Introducing Splunk 10.0: Smarter, Faster, and More Powerful Than Ever

Now On Demand Whether you're managing complex deployments or looking to future-proof your data ...

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...