Splunk Search

How to get table cell value using jquery?

jadengoho
Builder

I just want to know how can I get specific table cell value using script (jquery)

for example :
COLUMN VALUES
A ----------------1
B-----------------2
C-----------------3

how can I get the value "3" using script(jquery) after the table has done the loading?

0 Karma
1 Solution

jadengoho
Builder

Hi everyone ,
I just solve my problem
using jquery you can use

$('#table1').find("tr:eq(2)").find("td:eq(1)").html();
//('#table1') - table Name
// tr:eq(2) - table ROW
// td:eq(1) - table COLUMN

View solution in original post

0 Karma

jadengoho
Builder

Hi everyone ,
I just solve my problem
using jquery you can use

$('#table1').find("tr:eq(2)").find("td:eq(1)").html();
//('#table1') - table Name
// tr:eq(2) - table ROW
// td:eq(1) - table COLUMN
0 Karma

niketn
Legend

@jadengoho what is the criteria for finding 3?

1) Is it last value of VALUES field
2) The value of VALUES field when COLUMN value is C
3) Or both?
4) What do you want to do once the value is selected?

If you want to use Splunk JS Stack to find a specific result of search you can refer to the following documentation: http://dev.splunk.com/view/webframework-developapps/SP-CAAAEU6

On Similar Lines if you want based on Splunk JS Table Cell Renderer you can refer to Splunk Dashboard Examples App for examples with Table. Following is answer with three of them https://answers.splunk.com/answers/637615/why-is-the-table-cell-highlighting-not-reading-the.html

Finally, following would be CSS or jQuery selector where table ID is myTable1: #myTable1 tbody tr:last-child td:last-child. Following is an answer based on this: https://answers.splunk.com/answers/637804/create-a-drill-down-multiple-condition.html

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

jadengoho
Builder

Yes I want to get the value 3, let's say that the Colum (A, B, C ) are static, I just want to get the value of "C"

0 Karma

harishalipaka
Motivator
$('#tableid last-child').val();
Thanks
Harish
0 Karma

jadengoho
Builder

it doesn't return me anything ? just want to get the "3" using JQUERY

0 Karma
Get Updates on the Splunk Community!

Index This | I’m short for "configuration file.” What am I?

May 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with a Special ...

New Articles from Academic Learning Partners, Help Expand Lantern’s Use Case Library, ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Your Guide to SPL2 at .conf24!

So, you’re headed to .conf24? You’re in for a good time. Las Vegas weather is just *chef’s kiss* beautiful in ...