Dashboards & Visualizations

Splunk Panel as pop window for drilldown

Rukmani_Splunk
Path Finder

I  need to  have display  splunk  dashboard  as pop  window when we click  as drilldown.

 

For example index=_internal |stats count by source, sourcetype

when click on the  table it  should pop  up  a panel containing  the below search  

index_internal |table sourcetype

Labels (1)
0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

@Rukmani_Splunk 

Please check the below links for example code for required Solution.

splunk_dashboard_model_view_examples

XML

example_1.xml

JS

app.js

Model View Component 

ModalViewComponent.js

 

Please let me know incase any help you required on this code.

KV

0 Karma

Rukmani_Splunk
Path Finder

Hi  Thanks for your reply  , I  am very  new to  this  java script  

 and i  get  the belwo  error 

 

ncaught Error: Script error for: ../app/splunk_dashboard_model_view_examples/components/ModalViewComponent
http://requirejs.org/docs/errors.html#scripterror
at makeError (eval at module.exports (common.js:134), <anonymous>:166:17)
at HTMLScriptElement.onScriptError (eval at module.exports (common.js:134), <anonymous>:1689:36)

 

 

 

 

0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

@Rukmani_Splunk 

Can you please share your sample code?

KV

0 Karma

Rukmani_Splunk
Path Finder

require([
'underscore',
'".Modal.js"',
'splunkjs/mvc',
'splunkjs/mvc/searchmanager',
'splunkjs/mvc/simplexml/ready!'
], function(_, ModalViewComponent, mvc, SearchManager) {
var tableElement = mvc.Components.getInstance("tbl_1");
tableElement.on("click", function(e) {
console.log(e.data);
console.log(e.data['row.sourcetype']);
var modal = new ModalViewComponent({
title: "Demo Table View",
id: "tb1_1",
search: new SearchManager({
earliest_time: "-15m",
latest_time: "now",
preview: false,
cache: false,p
search: 'index=_internal sourcetype="' + e.data['row.sourcetype'] + '" | stats count by source'
}, { tokens: true, tokenNamespace: "submitted" }),
display_component: {
viz_model: require('splunkjs/mvc/tableview'),
viz_options: {
pageSize: '10',
data: "events",
drilldown: "row",
},
drilldown: (e) => {
console.log(e);
}
}
});
modal.show();
});
});

 

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas     Cisco Live 2026 is almost here, and this ...

What Is the Name of the USB Key Inserted by Bob Smith? (BOTS Hint, Not the Answer)

Hello Splunkers,   So you searched, “what is the name of the usb key inserted by bob smith?”  Not gonna lie… ...

Automating Threat Operations and Threat Hunting with Recorded Future

    Automating Threat Operations and Threat Hunting with Recorded Future June 29, 2026 | Register   Is your ...