Dashboards & Visualizations

Get the click.value in a event handler using SplunkJS

MikeJu25
Path Finder

Hi,

My dashboard has a row-clickable table. 

allassetstable.on("click", function(e) {
        // Bypass the default behavior
        e.preventDefault();
        // Displays a data object in the console
        console.log("Clicked the table:", e.data);
    });

 Now once I clicked the table, I got this from console: 

Clicked the table: 
{click.name: "database_id", click.value: "dfd033abe230eb961276fd5981c209f11b7925ee8736474265196215bc0f8b7d", click.name2: "database_id", click.value2: "dfd033abe230eb961276fd5981c209f11b7925ee8736474265196215bc0f8b7d", row.database_id: "dfd033abe230eb961276fd5981c209f11b7925ee8736474265196215bc0f8b7d", …}
click.name: "database_id"
click.name2: "database_id"
click.value: "dfd033abe230eb961276fd5981c209f11b7925ee8736474265196215bc0f8b7d"
click.value2: "dfd033abe230eb961276fd5981c209f11b7925ee8736474265196215bc0f8b7d"
earliest: "1621956660.000"
latest: 1624819906
row.anomaly_count: "144"

How should I modify the JS code to get the value stored in click.value instead of the entire data block? I tried e.data.click.value before but it didn't work out. 

Thank you in advance! 

Regards,

Labels (2)
0 Karma
1 Solution

kamlesh_vaghela
SplunkTrust
SplunkTrust

@MikeJu25 

Can you please try this?

allassetstable.on("click", function(e) {
    // Bypass the default behavior
    e.preventDefault();
    // Displays a data object in the console
    console.log(e.data['click.value'])
    console.log("Clicked the table:", e.data);
});

 

Thanks
KV
▄︻̷̿┻̿═━一

If any of my reply helps you to solve the problem Or gain knowledge, an upvote would be appreciated.

View solution in original post

kamlesh_vaghela
SplunkTrust
SplunkTrust

@MikeJu25 

Can you please try this?

allassetstable.on("click", function(e) {
    // Bypass the default behavior
    e.preventDefault();
    // Displays a data object in the console
    console.log(e.data['click.value'])
    console.log("Clicked the table:", e.data);
});

 

Thanks
KV
▄︻̷̿┻̿═━一

If any of my reply helps you to solve the problem Or gain knowledge, an upvote would be appreciated.

Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...