Dashboards & Visualizations

In Dashboard Studio, how to color code one table column based on value of hidden column.

edgarrity
Path Finder

The following Dashboard Studio code will display a three-column table with the last column color coded by the value of the last column.  How do I color code the second column by the value of the last column and hide the last column?

{
	"visualizations": {
		"viz_mGj9tW8N": {
			"type": "splunk.table",
			"dataSources": {
				"primary": "ds_EKJuCMzj"
			},
			"title": "Product List",
			"description": "Current prouct versions",
			"options": {
				"columnFormat": {
					"color_key": {
						"data": "> table | seriesByName(\"color_key\") | formatByType(color_keyColumnFormatEditorConfig)",
						"rowColors": "> table | seriesByName('color_key') | rangeValue(color_keyRowColorsEditorConfig)"
					}
				}
			},
			"context": {
				"color_keyColumnFormatEditorConfig": {
					"number": {
						"thousandSeparated": false,
						"unitPosition": "after"
					}
				},
				"color_keyRowColorsEditorConfig": [
					{
						"to": 20,
						"value": "#D41F1F"
					},
					{
						"from": 20,
						"to": 40,
						"value": "#D94E17"
					},
					{
						"from": 40,
						"to": 60,
						"value": "#CBA700"
					},
					{
						"from": 60,
						"to": 80,
						"value": "#669922"
					},
					{
						"from": 80,
						"value": "#118832"
					}
				]
			}
		}
	},
	"dataSources": {
		"ds_EKJuCMzj": {
			"type": "ds.search",
			"options": {
				"query": "| makeresults \r\n| eval Product = \"Circle\" \r\n| eval Version = \"1.2.3.4\" \r\n| eval color_key = 52 \r\n| eval _time=relative_time(now(), \"-1d@d\") \r\n| append \r\n    [| makeresults \r\n    | eval Product = \"Square\" \r\n    | eval Version = \"2.3.4.5\" \r\n    | eval color_key = 48 \r\n    | eval _time=relative_time(now(), \"-1d@d\") \r\n        ] \r\n| append \r\n    [| makeresults \r\n    | eval Product = \"Triangle\" \r\n    | eval Version = \"3.4.5.6\"\r\n    | eval color_key = 75 \r\n    | eval _time=relative_time(now(), \"-1d@d\") \r\n        ] \r\n| append \r\n    [| makeresults \r\n    | eval Product = \"Rectangle\" \r\n    | eval Version = \"4.5.6.7\" \r\n    | eval color_key = 4 \r\n    | eval _time=relative_time(now(), \"-1d@d\") \r\n        ] \r\n| append \r\n    [| makeresults \r\n    | eval Product = \"Oval\" \r\n    | eval Version = \"5.6.7.8\" \r\n    | eval color_key = 2 \r\n    | eval _time=relative_time(now(), \"-1d@d\") \r\n        ] \r\n| stats latest(Version) as Version latest(color_key) as color_key by Product",
				"queryParameters": {
					"earliest": "-24h@h",
					"latest": "now"
				}
			},
			"name": "Product List"
		}
	},
	"defaults": {
		"dataSources": {
			"ds.search": {
				"options": {
					"queryParameters": {
						"latest": "$global_time.latest$",
						"earliest": "$global_time.earliest$"
					}
				}
			}
		}
	},
	"inputs": {},
	"layout": {
		"type": "absolute",
		"options": {
			"display": "auto-scale"
		},
		"structure": [
			{
				"item": "viz_mGj9tW8N",
				"type": "block",
				"position": {
					"x": 0,
					"y": 0,
					"w": 340,
					"h": 300
				}
			}
		],
		"globalInputs": []
	},
	"description": "",
	"title": "Dynamic Coloring POC - SPLK-1271"
}

 

Labels (2)
0 Karma
Get Updates on the Splunk Community!

Splunk Observability Synthetic Monitoring - Resolved Incident on Detector Alerts

We’ve discovered a bug that affected the auto-clear of Synthetic Detectors in the Splunk Synthetic Monitoring ...

Video | Tom’s Smartness Journey Continues

Remember Splunk Community member Tom Kopchak? If you caught the first episode of our Smartness interview ...

3-2-1 Go! How Fast Can You Debug Microservices with Observability Cloud?

3-2-1 Go! How Fast Can You Debug Microservices with Observability Cloud? Learn how unique features like ...