Dashboards & Visualizations

How to change the font color on a condition

radha116
Explorer

created a query with data  in table as Name , app_status, Job_status. Both app_status and job_status has Success and Failed statuses as per conditional. What to change text color to red for failed and green for Success, I tried couple the format text changes the background color instead text color.

Thank you

 

Labels (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

There are a couple of tricks you can do with CSS (no JS required) which can be embedded into the SimpleXML of the dashboard (not requiring separate files).

See this response for an idea - if you need more explanation, please ask

https://community.splunk.com/t5/Splunk-Search/How-to-add-a-color-to-the-field-in-one-column-based-on...

 

0 Karma

venkatasri
SplunkTrust
SplunkTrust

Hi @radha116 

Yes it does change background color, you need to write custom JS  as described to achieve text color change refer - https://blog.avotrix.com/change-font-color-of-table-cell-value-in-splunk/

---

An upvote would be appreciated and Accept solution if it helps!

0 Karma
Get Updates on the Splunk Community!

Splunk Observability as Code: From Zero to Dashboard

For the details on what Self-Service Observability and Observability as Code is, we have some awesome content ...

[Puzzles] Solve, Learn, Repeat: Character substitutions with Regular Expressions

This challenge was first posted on Slack #puzzles channelFor BORE at .conf23, we had a puzzle question which ...

Shape the Future of Splunk: Join the Product Research Lab!

Join the Splunk Product Research Lab and connect with us in the Slack channel #product-research-lab to get ...