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

niketnilay
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

niketnilay
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

ramarcsight
Explorer

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

0 Karma

niketnilay
Legend

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

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma
Did you miss .conf21 Virtual?

Good news! The event's keynotes and many of its breakout sessions are now available online, and still totally FREE!