Splunk Search

How to find the location of a cell in a row

Marcovd
Explorer

How can I find the location of a cell in row?

I'm using javascript like:

var CustomRangeRenderer = TableView.BaseCellRenderer.extend({
    canRender: function(cell) {
        return true;
    },
    render: function($td, cell) {

I want to determine whether the cell I'm working on is the first cell (column) of a row.

I know that I can do cell.field and cell.value but what options are there anymore to ask to a cell?

Tags (2)
0 Karma
1 Solution

vganjare
Builder

There is not direct way of achieving this. But, you can try a trick. In the search, identify the column which is First column. Mark this field as first column (in search). e.g.
[base search] | fields col1, col2, col3, col4 | eval col1="FIRST_COLUMN_".col1

Now, in the js, by looking at the cell.value, you can identify if its first column or not and take necessary actions if required. Once identified, remove the token FIRST_COLUMN_ from the cell.value, so that user doesn't see this token in result.

Thanks!!

View solution in original post

vganjare
Builder

There is not direct way of achieving this. But, you can try a trick. In the search, identify the column which is First column. Mark this field as first column (in search). e.g.
[base search] | fields col1, col2, col3, col4 | eval col1="FIRST_COLUMN_".col1

Now, in the js, by looking at the cell.value, you can identify if its first column or not and take necessary actions if required. Once identified, remove the token FIRST_COLUMN_ from the cell.value, so that user doesn't see this token in result.

Thanks!!

Marcovd
Explorer

Easy and simple solution.
Thanks

0 Karma
Get Updates on the Splunk Community!

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

New Release | Splunk Cloud Platform 10.1.2507

Hello Splunk Community!We are thrilled to announce the General Availability of Splunk Cloud Platform 10.1.2507 ...

🌟 From Audit Chaos to Clarity: Welcoming Audit Trail v2

🗣 You Spoke, We Listened  Audit Trail v2 wasn’t written in isolation—it was shaped by your voices.  In ...