Hi rromanelli,
I also had the same issue and did it by using javascript.
I'm not sure you are Ok with javascript or not, So can you please try below code?
XML
<form script="myjs.js">
<label>test</label>
<row>
<panel>
<table id="table_link">
<search>
<query>index="_internal" | top 5 sourcetype | eval link="http://www.google.com"</query>
<earliest>-1h@h</earliest>
<latest>now</latest>
<sampleRatio>1</sampleRatio>
</search>
<option name="count">20</option>
<option name="dataOverlayMode">none</option>
<option name="drilldown">cell</option>
<option name="percentagesRow">false</option>
<option name="rowNumbers">false</option>
<option name="totalsRow">false</option>
<option name="wrap">true</option>
<drilldown>
<condition field="*">
</condition>
</drilldown>
</table>
</panel>
</row>
</form>
Javascript :
require([
'underscore',
'jquery',
'splunkjs/mvc',
'splunkjs/mvc/tableview',
'splunkjs/mvc/simplexml/ready!'
], function(_, $, mvc, TableView) {
var utils = require("splunkjs/mvc/utils");
var CustomRangeRenderer = TableView.BaseCellRenderer.extend({
canRender: function(cell) {
return _(['link']).contains(cell.field);
},
render: function($td, cell) {
$td.html("<div style='cursor:pointer;'>"+cell.value+"</div>").on("click", function (e){
console.log(cell.value);
utils.redirect(cell.value,"_blank");
});
}
});
//List of table IDs to add icon
var tableIDs = ["table_link"];
for (i=0;i<tableIDs.length;i++) {
var sh = mvc.Components.get(tableIDs[i]);
if(typeof(sh)!="undefined") {
sh.getVisualization(function(tableView) {
// Add custom cell renderer and force re-render
tableView.table.addCellRenderer(new CustomRangeRenderer());
tableView.table.render();
});
}
}
});
Let me know if it is useful.
Thanks
Kamlesh
... View more