Splunk Search

How to get the clicked value using javascript

Path Finder


Iam using simpleresultstable module with pager to show results like below.

a link

View http://www.some url
View http://www.some url
View http://www.some url

Now in application.js i use this following code to show the value when clicked.

switch (Splunk.util.getCurrentView()) {
case "dd1":
if (Splunk.Module.NullModule) {
Splunk.Module.NullModule = $.klass(Splunk.Module.NullModule, {
getModifiedContext: function() {

             var name = this.getContext().get("click.name");

               var val = this.getContext().get("click.value");
                 if (name == "a") {
                return context;


when i click the table it shows only the first column value in message box.

I want to get the clicked value in MessageBox.


Tags (1)
0 Karma


Jquery, which is built into Splunk, could be used.


(the .live has been replaced with .on in the current version of Jquery, but Splunk is using version 1.6, so .live will work.

if (Splunk.util.getCurrentView() == 'your_view_name' ) {

   $(".myButtonClass").live("click", function(event){
   var txt = $(this).text();
   var url = $(this).url();
0 Karma


What kind of drilldown are you using, row or all? You need to have drilldown set to all in your SimpleResultsTable module and then use the variable click.value2 to get the contents of the specific cell that is clicked. click.value just gives you the value of the first cell in the row clicked.


Path Finder

No I am not using any drill down here.Iam using javascript code to get the value in message box.

I found there is a possibilty to get the clicked value in message box.

The above table shows a and link columns.Iam displaying that using simpleresultstable module.When i click any cell value(second column cell value) it loads application.js file and after executing the script it shows the first column cell value only.But I want to get the link value say that(http://someurl).

0 Karma
.conf21 Now Fully Virtual!
Register for FREE Today!

We've made .conf21 totally virtual and totally FREE! Our completely online experience will run from 10/19 through 10/20 with some additional events, too!