Hi, if I understood right your requirement, you can add a button with JS in the table. When the button is clicked, it will trigger a splunk search to update a lookup where you will save the status change of the field solved. After the search is complete you can re-run the search in the table so see the update. You have also to change the search in the table in order to get the last updated value for the field solved. This flow can be done using JS. require([
'splunkjs/mvc',
'splunkjs/mvc/searchmanager',
'splunkjs/mvc/tableview',
'splunkjs/mvc/simplexml/ready!',
'jquery'
], function(mvc, SearchManager, TableView, ignored, $) {
// Define a simple cell renderer with a button
var ActionButtonRenderer = TableView.BaseCellRenderer.extend({
canRender: function(cell) {
return cell.field === 'myfieldwheredispaybutton';
},
render: function($td, cell) {
$td.addClass('button-cell');
var $btn = $('<button class="btn btn-primary">Execute</button>');
$btn.on('click', function(e) {
e.preventDefault();
e.stopPropagation();
var rowId = cell.value; // value from the cell (e.g., unique row ID)
console.log("Button clicked for row:", rowId);
var searchQuery = `| makeresults | eval row_id=\"${rowId}\", _time=now() | outputlookup append=true custom_lookup.csv`;
var writeSearch = new SearchManager({
id: "writeSearch_" + Math.floor(Math.random() * 100000),
search: searchQuery,
autostart: true
});
writeSearch.on('search:done', function() {
console.log("Search completed and lookup updated");
var panelSearch = mvc.Components.get('panel_search_id');
if (panelSearch) {
panelSearch.startSearch();
console.log("Panel search restarted");
}
});
});
$td.append($btn);
}
});
// Apply the renderer to the specified table
var tableComponent = mvc.Components.get('generic_table_id');
if (tableComponent) {
tableComponent.getVisualization(function(tableView) {
tableView.table.addCellRenderer(new ActionButtonRenderer());
tableView.table.render();
});
}
});
... View more