Dashboards & Visualizations

Why is Classic Time picker not cloned in dashboard studio?

marksheinbaum
Explorer

I'm experimenting with converting a classic dashboard to dashboard studio. The classic dashboard has a time picker used to establish a date range for searches in the panels. When I cloned the dashboard to dashboard studio, the time picker is no longer used. All the searches, are searching from the earliest date stored in Splunk which is several years worth of data. Can someone explain what is happening and how to fix. This should be a relatively simple thing to do.

Labels (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

So your earliest and latest are set to "all time" - change them to 

		"latest": "$global_time.latest$",
		"earliest": "$global_time.earliest$"

View solution in original post

0 Karma

marksheinbaum
Explorer

I accepted the solution. However, I'm surprised that the cloning process does not generate that automatically.

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

If you look at the source of the Studio Dashboard, you should be able to see which timepicker is being used. It is possibly global. Try changing this to your named timepicker.

	"defaults": {
		"dataSources": {
			"ds.search": {
				"options": {
					"queryParameters": {
						"latest": "$global_time.latest$",
						"earliest": "$global_time.earliest$"
					}
				}
			}
		}
	},
0 Karma

marksheinbaum
Explorer

Here's the code from the converted and unmodified dashboard. It's not clear to me exactly what to change per your advise. Can you please clarify? Thanks.

"inputs": {
"input_1": {
"type": "input.timerange",
"title": "Select a time:",
"options": {
"token": "global_time",
"defaultValue": "-60m@m,now"
}
},
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

That looks OK for a timepicker. What about how the datasources are defined? And the defaults?

0 Karma

marksheinbaum
Explorer

Here's how the visualization and corresponding data source are defined. I don't see a "default" in the code. 

"visualizations": {

        "viz_chart_1": {

            "type": "splunk.line",

            "dataSources": {

                "primary": "ds_search_1"

            },

            "showProgressBar": true,

            "title": "nodesim instances ram usage (ps)",

            "options": {

                "yAxisAbbreviation": "auto",

                "y2AxisAbbreviation": "off",

                "showRoundedY2AxisLabels": false,

                "legendTruncation": "ellipsisEnd",

                "showY2MajorGridLines": true,

                "yAxisMajorTickInterval": 1,

                "yAxisTitleText": "Megabytes",

                "nullValueDisplay": "connect",

                "dataValuesDisplay": "off",

                "legendDisplay": "bottom"

            },

            "context": {}

        },

 

"dataSources": {

        "ds_search_1": {

            "type": "ds.search",

            "options": {

                "query": "index=os (sourcetype=ps OR sourcetype=vmstat) (host=scale-sysperf-95x-install-18* ) (COMMAND=CURRENT* OR COMMAND=nodesim)\n| rename memTotalMB as physicalMB\n| appendpipe [ where sourcetype==\"vmstat\" | rename memUsedMB as physicalMB | eval App=\"Physical-Used\"   | fields  physicalMB]\n| stats count sum(RSZ_KB) as RSZ_KB_sum  max(physicalMB) as physicalMB  by _time host COMMAND\n| timechart span=1m avg(eval(if(isnull(physicalMB),RSZ_KB_sum/1000,physicalMB))) as AppRSZ_MB by host",

                "queryParameters": {

                    "earliest": 0,

                    "latest": ""

                }

            }

        },

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

So your earliest and latest are set to "all time" - change them to 

		"latest": "$global_time.latest$",
		"earliest": "$global_time.earliest$"
0 Karma
Get Updates on the Splunk Community!

Splunk Search APIを使えば調査過程が残せます

   このゲストブログは、JCOM株式会社の情報セキュリティ本部・専任部長である渡辺慎太郎氏によって執筆されました。 Note: This article is published in both Japanese ...

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 ...