Dashboards & Visualizations

How can i acheive the coloring based on two column values?

ramarcsight
Explorer

hello everyone i have a table like this

| makeresults
| eval time_diff=4
|eval datapoint=3
| table time_diff datapoint

time_diff datapoint
4 3

what i want is i want this table on a dashboard in such a way that when the both values r equal the row should be colored green , when they are not equal red
is that possible?
Please post the XML if you can , thank you very much

Tags (1)
0 Karma
1 Solution

niketn
Legend

@ramarcsight, refer to this answer by @kamlesh_vaghela https://answers.splunk.com/answers/661894/how-to-color-cell-contents-with-css-and-js.html#answer-661...

You can combine two columns together in the table.
Then use Splunk JS to parse the combined cell value to decide the color the applied.
Finally, within Splunk JS split the combined column into two separate columns as per the requirement.

Please try out and let us know if it does not work. If it does work, do not forget to up vote the answer by Kamlesh in the provided link.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

View solution in original post

niketn
Legend

@ramarcsight, refer to this answer by @kamlesh_vaghela https://answers.splunk.com/answers/661894/how-to-color-cell-contents-with-css-and-js.html#answer-661...

You can combine two columns together in the table.
Then use Splunk JS to parse the combined cell value to decide the color the applied.
Finally, within Splunk JS split the combined column into two separate columns as per the requirement.

Please try out and let us know if it does not work. If it does work, do not forget to up vote the answer by Kamlesh in the provided link.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

ramarcsight
Explorer

Definitely i wil try and let you know , Thank you very much !!

0 Karma

niketn
Legend

@ramarcsight , seems like your issue is resolved. Do up vote the original answer by @kamlesh_vaghela.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...