Dashboards & Visualizations

How to create a list of all the values clicked on from a result set configured for dynamic drilldown?

swajapey
Engager

So, I have a result set which has been configured for dynamic drilldown. All I want to do is, once I select a element in the result set, it should open a new table with that value and all my subsequent clicks on the original result set must create a table.

Basically, it should create a list of all the elements I clicked from the original search result.

Urgent !!! please help

jeffland
SplunkTrust
SplunkTrust

By default, you can't add things to a token, you can only set it. How would you ever clear a token if each click in your table added something to it?

You can of course do this with custom javascript. You need to give your table an id, and in js on the click event of that table add the clicked value to the token. Should look something like

var table = mvc.Components.get("tableId"); // Get table by id given in Simple XML
var tokens = mvc.Components.get("default"); // Get default token model
table.on("click", function(e) {
    if (e.field !== undefined) {
        e.preventDefault(); // Prevent default drilldown behavior
        var oldValue = tokens.get("yourToken");
        tokens.set("yourToken", oldValue + " " + e.data["click.value2"]); // Add new values to token
    }
});

I would also recommend adding a button somewhere to reset the token to empty.

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

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

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...