I have a query whose one of the field named system is having values BMS or CCTV (total 10 fields are there in table format ) and I am showing the fields for those system in a table format and using the single value viz to show the values in the trellis format. I have applied some CSS to customize trellis. Now, I want to show that if System=BMS then all background color of all trellis fields should be changed to GREEN and if System=CCTV, then it should be changed to "AMBER", as if I have to show the whole row as GREEN or AMBER based on "System" field value. Also some field values are text and some are date along with numeric values, as attached in the image.
My query is same, and I am just passing $token$ to select the Division based on which the value of "System" field changes ( in this case either BMS or CCTV). I tried using status indicator app, but somehow the trellis is not showing values for the fields in that, and hence I used "single value" viz. Attached are the images for your reference :
My query is like below :
.... | sort - Total | sort - Division | search Division=SAS | fields - Full_Name Division | search System=CCTV OR System=BMS
where Division value is a token, when Division=SAS, then it returns System=CCTV and when Division=FM, it returns row System=BMS ?
So, when System value is CCTV, the whole row background color should be GREEN and for System=BMS the background color should be AMBER and that too it should be in "single value" viz using trellis layout ? How can I achieve this ?
![alt text][2] [2]: /storage/temp/290867-query-output-table.png
Hi @pgadhari please try the following approach:
Step 1 Use one of my old answers to color table row based on expression (SimpleXML with CSS, but you can use JS as well): https://answers.splunk.com/answers/820403/how-to-change-font-color-based-on-a-condition-for.html
Step 2 Then use the other answer to format the table as Single Value as per this answer: https://answers.splunk.com/answers/529004/is-there-a-way-to-display-more-than-20-charts-at-a.html
Second option could be to try this with JS. Let me know if above does not work!
I will try to use the table and see how it looks instead of single viz and revert.
I have changed the viz to table and used format option to apply colors. I am ok with it. Thanks for your step-1.