Dashboards & Visualizations

"Customized in source" option to set background color for Single Value does not work

Zhongtan
New Member

I tried to use "customized in source" option in Splunk Cloud (9.1.2312.203) Dashboard Studio to create a Single Value which background color is controlled by search result.

However the code does not work.  The same code below is tested with statics option which works well.


Below is Dashboard JSON

{
    "visualizations": {
        "viz_74mllhEE": {
            "type": "splunk.singlevalue",
            "options": {
                "majorValue": "> sparklineValues | lastPoint()",
                "trendValue": "> sparklineValues | delta(-2)",
                "sparklineValues": "> primary | seriesByName('background_color')",
                "sparklineDisplay": "off",
                "trendDisplay": "off",
                "majorColor": "#0877a6",
                "backgroundColor": "> primary | seriesByName('background_color')"
            },
            "dataSources": {
                "primary": "ds_00saKHxb"
            }
        }
    },
    "dataSources": {
        "ds_00saKHxb": {
            "type": "ds.search",
            "options": {
                "query": "| makeresults \n| eval background_color=\"#53a051\"\n"
            },
            "name": "Search_1"
        }
    },
    "defaults": {
        "dataSources": {
            "ds.search": {
                "options": {
                    "queryParameters": {
                        "latest": "$global_time.latest$",
                        "earliest": "$global_time.earliest$"
                    }
                }
            }
        }
    },
    "inputs": {
        "input_global_trp": {
            "type": "input.timerange",
            "options": {
                "token": "global_time",
                "defaultValue": "-24h@h,now"
            },
            "title": "Global Time Range"
        }
    },
    "layout": {
        "type": "absolute",
        "options": {
            "width": 1440,
            "height": 960,
            "display": "auto"
        },
        "structure": [
            {
                "item": "viz_74mllhEE",
                "type": "block",
                "position": {
                    "x": 0,
                    "y": 0,
                    "w": 250,
                    "h": 250
                }
            }
        ],
        "globalInputs": [
            "input_global_trp"
        ]
    },
    "description": "",
    "title": "ztli_test"
}
Labels (2)
0 Karma
Get Updates on the Splunk Community!

Earn a $35 Gift Card for Answering our Splunk Admins & App Developer Survey

Survey for Splunk Admins and App Developers is open now! | Earn a $35 gift card!      Hello there,  Splunk ...

Continuing Innovation & New Integrations Unlock Full Stack Observability For Your ...

You’ve probably heard the latest about AppDynamics joining the Splunk Observability portfolio, deepening our ...

Monitoring Amazon Elastic Kubernetes Service (EKS)

As we’ve seen, integrating Kubernetes environments with Splunk Observability Cloud is a quick and easy way to ...