Splunk Search

Is there a way to remove the digits from columns in Splunk Dashboard?



I am currently working is on one use case where i have to display store number on the basis of avg cpu, avg ram and avg iowait.
I have used stats command and created a table and used eval command to put threshold.
I want to display only the color in the column based on the value of avg cpu, avg ram and avg iowait but not there values in the column. Is there any way which i can use to display only colors.

Secondly i was trying to add a 4th column which will display number of days the store's are in red(threshold above 90).

Thanks in advance.

Tags (3)
0 Karma



Try this

<dashboard script="test.js">
      <table id="my_table">
          <query>| makeresults 
| eval "avg cpu" =30, "avg ram"=40 , "avg iowait"=50, threshold=92 
| append 
    [| makeresults 
    | eval "avg cpu" =60, "avg ram"=90 , "avg iowait"=10, threshold=80] 
| table "avg cpu", "avg ram" , "avg iowait", threshold</query>
        <option name="drilldown">none</option>
      .css_high { 
 .css_low { 
 .css_medium { 


], function(_, $, mvc, TableView) {

    var CustomRangeRenderer = TableView.BaseCellRenderer.extend({
        canRender: function(cell) {
            return _(['avg cpu','avg ram','avg iowait','threshold']).contains(cell.field);
        render: function($td, cell) {
            var value = cell.value;
            var label=" ";
            if(cell.field=="avg cpu" || cell.field=="avg ram" || cell.field=="avg iowait"){
                if(value >0 && value<=30){
                    $td.html("<div class='css_low'>"+label+"</div>")
                }else if(value >30 && value<=60){
                    $td.html("<div class='css_medium'>"+label+"</div>")
                }else if(value >60){
                    $td.html("<div class='css_high'>"+label+"</div>")
                if(value >90){
                    $td.html("<div class='css_high'>"+value+"</div>")
                    $td.html("<div class='align_center'>"+value+"</div>")

    var tableIDs = ["my_table"];
    for (i=0;i<tableIDs.length;i++) {
        var sh = mvc.Components.get(tableIDs[i]);
        if(typeof(sh)!="undefined") {
            sh.getVisualization(function(tableView) {
                tableView.table.addCellRenderer(new CustomRangeRenderer());
0 Karma
Get Updates on the Splunk Community!

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

March Community Office Hours Security Series Uncovered!

Hello Splunk Community! In March, Splunk Community Office Hours spotlighted our fabulous Splunk Threat ...

Stay Connected: Your Guide to April Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars in April. This post ...