Dashboards & Visualizations

Changing colors in Dashboard Studio

splunkbeast
New Member

Hello Splunk Champs 

I am trying to do something in studio and stuck with something  

If you see the picture, is it possible to change the color of boxes as per the status . like if status icon(snall circle) is green then the background color should be white and same for other services as per picture . 

splunkbeast_1-1764843580027.png

 

 

Labels (1)
0 Karma

forecastingLogs
Splunk Employee
Splunk Employee

What you can do is add the same data source for either image, and changes the color values accordingly, for example: 

{
    "title": "draw",
    "description": "",
    "inputs": {
        "input_global_trp": {
            "options": {
                "defaultValue": "-24h@h,now",
                "token": "global_time"
            },
            "title": "Global Time Range",
            "type": "input.timerange"
        }
    },
    "defaults": {
        "dataSources": {
            "ds.o11y": {
                "options": {
                    "queryParameters": {
                        "earliest": "$global_time.earliest$",
                        "latest": "$global_time.latest$"
                    }
                }
            },
            "ds.search": {
                "options": {
                    "queryParameters": {
                        "earliest": "$global_time.earliest$",
                        "latest": "$global_time.latest$"
                    }
                }
            }
        },
        "visualizations": {
            "global": {
                "showProgressBar": true
            }
        }
    },
    "visualizations": {
        "viz_OpC1vLYF": {
            "context": {
                "fillColorEditorConfig": [
                    {
                        "to": 5,
                        "value": "#000000"
                    },
                    {
                        "from": 5,
                        "value": "#ffffff"
                    }
                ],
                "fillDataValue": "> primary | seriesByType(\"number\") | lastPoint()"
            },
            "dataSources": {
                "primary": "ds_FPMB4FhR"
            },
            "options": {
                "fillColor": "> fillDataValue | rangeValue(fillColorEditorConfig)"
            },
            "type": "splunk.rectangle"
        },
        "viz_ksk466cv": {
            "context": {
                "fillColorEditorConfig": [
                    {
                        "to": 5,
                        "value": "#D41F1F"
                    },
                    {
                        "from": 5,
                        "value": "#118832"
                    }
                ],
                "fillDataValue": "> primary | seriesByType(\"number\") | lastPoint()"
            },
            "dataSources": {
                "primary": "ds_FPMB4FhR"
            },
            "eventHandlers": [
                {
                    "options": {
                        "tokens": [
                            {
                                "key": "row.<fieldname>.value",
                                "token": "value"
                            }
                        ]
                    },
                    "type": "drilldown.setToken"
                }
            ],
            "options": {
                "fillColor": "> fillDataValue | rangeValue(fillColorEditorConfig)"
            },
            "type": "splunk.ellipse"
        }
    },
    "dataSources": {
        "ds_FPMB4FhR": {
            "name": "Search_2",
            "options": {
                "query": "| makeresults count=1\n| eval rand=random()%10+1\n| table rand"
            },
            "type": "ds.search"
        },
        "ds_LuczsK7H": {
            "name": "Search_1",
            "options": {
                "query": "|  makeresults count=1\n| eval test=$rand$\n| table test"
            },
            "type": "ds.search"
        }
    },
    "layout": {
        "globalInputs": [
            "input_global_trp"
        ],
        "layoutDefinitions": {
            "layout_1": {
                "options": {
                    "display": "auto",
                    "height": 960,
                    "width": 1440
                },
                "structure": [
                    {
                        "item": "viz_OpC1vLYF",
                        "position": {
                            "h": 270,
                            "w": 240,
                            "x": 550,
                            "y": 50
                        },
                        "type": "block"
                    },
                    {
                        "item": "viz_ksk466cv",
                        "position": {
                            "h": 150,
                            "w": 160,
                            "x": 590,
                            "y": 130
                        },
                        "type": "block"
                    }
                ],
                "type": "absolute"
            }
        },
        "options": {},
        "tabs": {
            "items": [
                {
                    "label": "New tab",
                    "layoutId": "layout_1"
                }
            ]
        }
    }
}
0 Karma
Get Updates on the Splunk Community!

Accelerating Observability as Code with the Splunk AI Assistant

We’ve seen in previous posts what Observability as Code (OaC) is and how it’s now essential for managing ...

Integrating Splunk Search API and Quarto to Create Reproducible Investigation ...

 Splunk is More Than Just the Web Console For Digital Forensics and Incident Response (DFIR) practitioners, ...

Congratulations to the 2025-2026 SplunkTrust!

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