Dashboards & Visualizations

Call custom command on drilldown from a dashboard.

Path Finder

Hello Splunk Developers
I need to call a custom command on click of a drilldown on a table cell in dashboard. The action should call the custom command behind the screen and upon completion of command execution should be able to update another cell in the table.

Have anybody came across this kind of requirement and able to code the requirement? Any guide/help is appreciated. Thanks in Advance.

0 Karma

New Member

We can use html dashboard for this.

We trigger a dropdown change event.
you get the value and by using that you can trigger a search or a oneshot query
and on success of the search you can get the value and update the other cell.


0 Karma


@bhupalbobbadi the token you set from table drilldown can be passed on to an independent search with dummy dependency which can run your custom command. On completion of that independent search you can set another token through <done> search event handler, which would add a dummy dependency back to the table to refresh the same.

| makeresults | eval message= "Happy Splunking!!!"
0 Karma


Hi, that's an interesting challenge. The click on the table can easily be intercepted by JavaScript. If the code that you need to run should be executed on the client, implement it in a custom .js. I assume, however, that you'd want to execute the code on a server (possibly the splunk server itself). In that case, you need to have some sort of REST endpoint on the server that gets called through the URL that you put inside the drilldown link. The call to the REST then runs your script on the server. If it's the splunk server you want to use, take a look at: https://answers.splunk.com/answers/730196/how-to-make-a-custom-rest-endpoint-in-splunk.html
After the code executes, return a HTML redirect from the REST call to the client back to the page/URL that you came from, resulting in the refresh of the dashboard.

0 Karma
Did you miss .conf21 Virtual?

Good news! The event's keynotes and many of its breakout sessions are now available online, and still totally FREE!