You can achieve this by using JS extension. Try the below code.
<dashboard version="1.1" script="a.js">
<label>version column</label>
<row>
<panel>
<table id="tknTable">
<search>
<query>| makeresults
| eval title="XYZ", version="3.0.0", updatedversion="3.0.1"
| eval flag= if(updatedversion > version, "1","0")
| eval updatedversion=updatedversion+"|"+flag
| table title version updatedversion</query>
<earliest>-24h@h</earliest>
<latest>now</latest>
</search>
<option name="drilldown">none</option>
<option name="refresh.display">progressbar</option>
</table>
</panel>
</row>
</dashboard>
require([
'underscore',
'jquery',
'splunkjs/mvc',
'splunkjs/mvc/tableview',
'splunkjs/mvc/simplexml/ready!'
], function(_, $, mvc, TableView) {
var CustomRangeRenderer = TableView.BaseCellRenderer.extend({
canRender: function(cell) {
//console.log("Enable this custom cell renderer for field");
return _(["updatedversion"]).contains(cell.field);
},
render: function($td, cell) {
var strCellValue = cell.value.split("|")[0];
var strFlag = cell.value.split("|")[1];
if (cell.field === "updatedversion" && strFlag=="1") {
var strHtmlInput="<div style='background-color:DodgerBlue'>"+strCellValue+"</div>";
} else {
var strHtmlInput="<div>"+strCellValue+"</div>";
}
$td.append(strHtmlInput);
}
});
mvc.Components.get('tknTable').getVisualization(function(tableView) {
// Add custom cell renderer, the table will re-render automatically.
tableView.table.addCellRenderer(new CustomRangeRenderer());
tableView.table.render();
});
});
Note: Change style as per your requirement.
I hope this will help you.
Thanks
KV
If any of my replies help you to solve the problem Or gain knowledge, an upvote would be appreciated.