<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to highlight table cell based on few conditions? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-highlight-table-cell-based-on-few-conditions/m-p/435930#M171602</link>
    <description>&lt;P&gt;hi&lt;BR /&gt;
the cell coloring depends only on the value of those fields&lt;BR /&gt;
it should be colored only if both conditions are happening &lt;BR /&gt;
so if Layer &amp;lt; 26 and HeadVoltage &amp;gt;29 for example then both Layer and HeadVoltage should be red&lt;/P&gt;

&lt;P&gt;i tried the example you posted but it is coloring the cells if one of the conditions are true&lt;/P&gt;</description>
    <pubDate>Wed, 01 May 2019 07:00:38 GMT</pubDate>
    <dc:creator>sarit_s</dc:creator>
    <dc:date>2019-05-01T07:00:38Z</dc:date>
    <item>
      <title>How to highlight table cell based on few conditions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-highlight-table-cell-based-on-few-conditions/m-p/435923#M171595</link>
      <description>&lt;P&gt;Hello&lt;BR /&gt;
i have a table with multiple fields but i want to highlight only few of them based on some conditions:&lt;BR /&gt;
the relevant columns are : &lt;BR /&gt;
HeadVoltage, Voltage_before_optimization, Layer&lt;BR /&gt;
i want to highlight them if Layer&amp;lt;=26 and (HeadVoltage&amp;gt;=29 OR Voltage_before_optimization&amp;gt;=29)&lt;BR /&gt;
**the numbers in those fields are float&lt;BR /&gt;
i want to have only severe (red) color&lt;/P&gt;

&lt;P&gt;this is my js file:         &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; /* TODO: jink to replace theme_utils with that from core */
require.config({
  paths: {
    theme_utils: '../app/simple_xml_examples/theme_utils'
  }
});
require([
    'underscore',
    'jquery',
    'splunkjs/mvc',
    'splunkjs/mvc/tableview',
    'theme_utils',
    'splunkjs/mvc/simplexml/ready!'
], function(_, $, mvc, TableView, themeUtils) {

     // Row Coloring Example with custom, client-side range interpretation

    var isDarkTheme = themeUtils.getCurrentTheme &amp;amp;&amp;amp; themeUtils.getCurrentTheme() === 'dark';

    var CustomRangeRenderer = TableView.BaseCellRenderer.extend({
        canRender: function(cell) {
            // Enable this custom cell renderer for both the active_hist_searches and the active_realtime_searches field
            return _(['HeadVoltage', 'Voltage_before_optimization','Layer']).contains(cell.field);
        },
        render: function($td, cell) {
            // Add a class to the cell based on the returned value
            var value = parseFloat(cell.value);

            // Apply interpretation for number of historical searches

          if (cell.field === 'HeadVoltage' || cell.field === 'Voltage_before_optimization') {
                if (value &amp;gt;= 29) {
                        if (cell.field === 'Layer') {
                                if (value &amp;lt;= 26) {
                                    $td.addClass('range-cell').addClass('range-severe');
                                                }
                        }
                }
               // else if (value &amp;gt; 1) {
                //    $td.addClass('range-cell').addClass('range-elevated');
                //}
                else if (value &amp;lt; 29) {
                    $td.addClass('range-cell').addClass('range-low');
                }
            }

            // Apply interpretation for number of realtime searches
            //if (cell.field === 'active_realtime_searches') {
             //   if (value &amp;gt; 1) {
              //      $td.addClass('range-cell').addClass('range-severe');
               // }
//            }
                   if (cell.field === 'HeadVoltage' || cell.field === 'Voltage_before_optimization') {
                if (value &amp;gt;= 29) {
                        if (cell.field === 'Layer') {
                                if (value &amp;lt;= 26) {
                                    $td.addClass('range-cell').addClass('range-severe');
                                                }
                        }
                }


            if (isDarkTheme) {
              $td.addClass('dark');
            }

            // Update the cell content
            $td.text(value.toFixed(2)).addClass('numeric');
        }
    });

    mvc.Components.get('highlight').getVisualization(function(tableView) {
        // Add custom cell renderer, the table will re-render automatically.
        tableView.addCellRenderer(new CustomRangeRenderer());
    });

});
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;my css file:  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  /* Cell Highlighting */
    /* 
    #highlight td {
        background-color: #c1ffc3 !important;
    }
    */
    #highlight td.range-low {
        color: #C0D9D9;
    }
    #highlight td.range-elevated {
        background-color: #ffc57a !important;
        font-weight: bold;
    }
    #highlight td.range-severe {
        background-color: #d59392 !important;
        font-weight: bold;
    }
    /* Dark Theme */
    #highlight td.dark {
        color: #F2F4F5;
    }
    #highlight td.range-low.dark {
        color: #006D9C;
    }
    #highlight td.range-elevated.dark {
        background-color: #EC9960 !important;
        font-weight: bold;
    }
    #highlight td.range-severe.dark {
        background-color: #AF575A !important;
        font-weight: bold;
    }
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;my first line in xml : &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;   &amp;lt;dashboard script="table_cell_highlighting.js" stylesheet="table_cell_highlighting.css"&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;it is not working. what am i missing ?&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:18:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-highlight-table-cell-based-on-few-conditions/m-p/435923#M171595</guid>
      <dc:creator>sarit_s</dc:creator>
      <dc:date>2020-09-30T00:18:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to highlight table cell based on few conditions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-highlight-table-cell-based-on-few-conditions/m-p/435924#M171596</link>
      <description>&lt;P&gt;any idea anyone ?&lt;/P&gt;

&lt;P&gt;i guess the problem is with the multiple conditions because if im running for only one of the fields each time it is working&lt;/P&gt;

&lt;P&gt;but i need that it will color the field only if it match both conditions..  &lt;/P&gt;</description>
      <pubDate>Tue, 30 Apr 2019 20:47:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-highlight-table-cell-based-on-few-conditions/m-p/435924#M171596</guid>
      <dc:creator>sarit_s</dc:creator>
      <dc:date>2019-04-30T20:47:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to highlight table cell based on few conditions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-highlight-table-cell-based-on-few-conditions/m-p/435925#M171597</link>
      <description>&lt;P&gt;checkout this example:&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/742882/color-rows-based-on-two-fields-conditions.html"&gt;https://answers.splunk.com/answers/742882/color-rows-based-on-two-fields-conditions.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;overall, id go with creating a new field &lt;BR /&gt;
&lt;CODE&gt;... your search ... | eval highlight = if(Layer&amp;lt;=26 and (HeadVoltage&amp;gt;=29 OR Voltage_before_optimization&amp;gt;=29),1,0)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;run this search anywhere, save as dashboard panel. and add the relevant lines to the xml code under the &lt;CODE&gt;&amp;lt;table&amp;gt;&lt;/CODE&gt; attribute / element:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults count=1
| eval appliances = "oven,microwave,dishwasher,laundry machine, dryer"
| makemv delim="," appliances
| mvexpand appliances
| eval Layer = random()%40
| eval HeadVoltage = random()%50
| eval Voltage_before_optimization = random()%60
| eval highlight = if(Layer&amp;lt;=26 and (HeadVoltage&amp;gt;=29 OR Voltage_before_optimization&amp;gt;=29),1,0)
| table appliances Layer HeadVoltage Voltage_before_optimization highlight
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and add the relevant lines to the xml code under the &lt;CODE&gt;&amp;lt;table&amp;gt;&lt;/CODE&gt; attribute / element:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;format type="color" field="highlight"&amp;gt;
           &amp;lt;colorPalette type="map"&amp;gt;{"0":#00FF3E,"1":#FF5733}&amp;lt;/colorPalette&amp;gt;
         &amp;lt;/format&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;hope it helps&lt;/P&gt;</description>
      <pubDate>Wed, 01 May 2019 02:33:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-highlight-table-cell-based-on-few-conditions/m-p/435925#M171597</guid>
      <dc:creator>adonio</dc:creator>
      <dc:date>2019-05-01T02:33:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to highlight table cell based on few conditions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-highlight-table-cell-based-on-few-conditions/m-p/435926#M171598</link>
      <description>&lt;P&gt;hi&lt;BR /&gt;
thanks !&lt;BR /&gt;
it is highlight the highlight column but there are few issues:&lt;BR /&gt;
1. i don't want it to highligh seperate column but the "layer", "head voltage" and "Voltage_before_optimization" columns&lt;BR /&gt;
2. it highlights the highlight column but not at the right places.. &lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:19:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-highlight-table-cell-based-on-few-conditions/m-p/435926#M171598</guid>
      <dc:creator>sarit_s</dc:creator>
      <dc:date>2020-09-30T00:19:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to highlight table cell based on few conditions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-highlight-table-cell-based-on-few-conditions/m-p/435927#M171599</link>
      <description>&lt;P&gt;@sarit_s &lt;/P&gt;

&lt;P&gt;Check out this. The trick might be useful to you.&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/661894/how-to-color-cell-contents-with-css-and-js.html"&gt;https://answers.splunk.com/answers/661894/how-to-color-cell-contents-with-css-and-js.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 May 2019 05:17:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-highlight-table-cell-based-on-few-conditions/m-p/435927#M171599</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2019-05-01T05:17:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to highlight table cell based on few conditions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-highlight-table-cell-based-on-few-conditions/m-p/435928#M171600</link>
      <description>&lt;P&gt;hi &lt;BR /&gt;
thanks for your reply.. &lt;BR /&gt;
it is not what im looking for&lt;BR /&gt;
my problem is that i have few conditions that should happen before coloring and i think that i wrote it in the js script incorrectly &lt;/P&gt;

&lt;P&gt;i will try to explain it better:&lt;BR /&gt;
i have 3 fields &lt;BR /&gt;
Layer, HeadVoltage, Voltage_before_optimization&lt;BR /&gt;
i need to check if (HeadVoltage &amp;gt; 29 OR Voltage_before_optimization &amp;gt; 29 ) and (Layer &amp;lt; 26)&lt;BR /&gt;
then&lt;BR /&gt;
color the relevant cells in red (ie HeadVoltage and Latey or Voltage_before_optimization and Layer)&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:19:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-highlight-table-cell-based-on-few-conditions/m-p/435928#M171600</guid>
      <dc:creator>sarit_s</dc:creator>
      <dc:date>2020-09-30T00:19:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to highlight table cell based on few conditions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-highlight-table-cell-based-on-few-conditions/m-p/435929#M171601</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/149978"&gt;@sarit_s&lt;/a&gt;&lt;BR /&gt;
Is the cell colour of &lt;CODE&gt;Layer&lt;/CODE&gt;, &lt;CODE&gt;HeadVoltage&lt;/CODE&gt; and &lt;CODE&gt;Voltage_before_optimization&lt;/CODE&gt; is depends on the value of other cells? like does &lt;CODE&gt;Layer&lt;/CODE&gt; is depending on &lt;CODE&gt;HeadVoltage&lt;/CODE&gt; or &lt;CODE&gt;Voltage_before_optimization&lt;/CODE&gt;?&lt;/P&gt;

&lt;P&gt;AND&lt;/P&gt;

&lt;P&gt;Have you tried with separating conditions in js?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;if (cell.field === 'HeadVoltage' &amp;amp; value &amp;gt;= 29) {
         $td.addClass('range-cell').addClass('range-severe');
}

if (cell.field === 'Voltage_before_optimization' &amp;amp; value &amp;gt;= 29) {
         $td.addClass('range-cell').addClass('range-severe');
}

if (cell.field === 'Layer' &amp;amp; value &amp;lt; 26) {
         $td.addClass('range-cell').addClass('range-severe');
}
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:19:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-highlight-table-cell-based-on-few-conditions/m-p/435929#M171601</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2020-09-30T00:19:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to highlight table cell based on few conditions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-highlight-table-cell-based-on-few-conditions/m-p/435930#M171602</link>
      <description>&lt;P&gt;hi&lt;BR /&gt;
the cell coloring depends only on the value of those fields&lt;BR /&gt;
it should be colored only if both conditions are happening &lt;BR /&gt;
so if Layer &amp;lt; 26 and HeadVoltage &amp;gt;29 for example then both Layer and HeadVoltage should be red&lt;/P&gt;

&lt;P&gt;i tried the example you posted but it is coloring the cells if one of the conditions are true&lt;/P&gt;</description>
      <pubDate>Wed, 01 May 2019 07:00:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-highlight-table-cell-based-on-few-conditions/m-p/435930#M171602</guid>
      <dc:creator>sarit_s</dc:creator>
      <dc:date>2019-05-01T07:00:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to highlight table cell based on few conditions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-highlight-table-cell-based-on-few-conditions/m-p/435931#M171603</link>
      <description>&lt;P&gt;i think that the problem is that the JS don't know which cell to color.. &lt;/P&gt;

&lt;P&gt;the condition is :&lt;BR /&gt;
     if ((cell.field === 'Voltage_before_optimization' &amp;amp;&amp;amp; value &amp;gt; 29)) &amp;amp;&amp;amp; (cell.field === 'Layer'  &amp;amp;&amp;amp; value1 &amp;lt; 26)) {&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;                        $td.addClass('range-cell').addClass('range-severe');

}
                        else if (( cell.field === 'HeadVoltage' &amp;amp;&amp;amp; value &amp;gt; 29) &amp;amp;&amp;amp; (cell.field === 'Layer' &amp;amp;&amp;amp; value1 &amp;lt; 26)) {
                            {

                              $td.addClass('range-cell').addClass('range-severe');
                }
            }
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and i think that since the condition contains 3 cells it failed..&lt;/P&gt;

&lt;P&gt;what do you think ? &lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:19:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-highlight-table-cell-based-on-few-conditions/m-p/435931#M171603</guid>
      <dc:creator>sarit_s</dc:creator>
      <dc:date>2020-09-30T00:19:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to highlight table cell based on few conditions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-highlight-table-cell-based-on-few-conditions/m-p/435932#M171604</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/149978"&gt;@sarit_s&lt;/a&gt;&lt;/P&gt;

&lt;P&gt;Can you please try this Dashboard code? Here I have shared scenario specific code. I have made trick in search and used in javascript. Try and let me know if any issue.  &lt;/P&gt;

&lt;P&gt;table_cell_highlighting.css&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;#highlight div.range-severe {
 background-color: #d59392 !important;
 font-weight: bold;
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;table_cell_highlighting.js&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;require([
     'underscore',
     'jquery',
     'splunkjs/mvc',
     'splunkjs/mvc/tableview',
     'splunkjs/mvc/simplexml/ready!'
 ], function(_, $, mvc, TableView) {

     var CustomRangeRenderer = TableView.BaseCellRenderer.extend({
         canRender: function(cell) {
             return _(['HeadVoltage', 'Voltage_before_optimization', 'Layer']).contains(cell.field);
         },
         render: function($td, cell) {
            var cell_value = cell.value;
            var HeadVoltage = cell_value.split("|")[0];
            var Voltage_before_optimization = cell_value.split("|")[1];
            var Layer = cell_value.split("|")[2];           
            if (HeadVoltage &amp;gt; 29 &amp;amp;&amp;amp; Layer &amp;gt; 26)
            {
                if (cell.field === 'HeadVoltage'){
                    $td.html("&amp;lt;div class='range-severe'&amp;gt;"+HeadVoltage+"&amp;lt;/div&amp;gt;")
                } else if(cell.field === 'Voltage_before_optimization') {
                    $td.html("&amp;lt;div&amp;gt;"+Voltage_before_optimization+"&amp;lt;/div&amp;gt;")
                } else if(cell.field === 'Layer') {
                    $td.html("&amp;lt;div class='range-severe'&amp;gt;"+Layer+"&amp;lt;/div&amp;gt;")
                }
            }
         }
     });

     //List of table IDs to add icon
     var tableIDs = ["highlight"];
     for (i=0;i&amp;lt;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();
             });
         }
     }    
 });
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;XML&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;dashboard script="table_cell_highlighting.js" stylesheet="table_cell_highlighting.css"&amp;gt;
  &amp;lt;label&amp;gt;Cell Color on the based of other cells&amp;lt;/label&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;table id="highlight"&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;| makeresults | eval HeadVoltage=31, Voltage_before_optimization=30, Layer=27 | eval temp=HeadVoltage."|".Voltage_before_optimization."|".Layer,HeadVoltage=temp, Voltage_before_optimization=temp, Layer=temp  | table HeadVoltage Voltage_before_optimization Layer&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-24h@h&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
          &amp;lt;sampleRatio&amp;gt;1&amp;lt;/sampleRatio&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="count"&amp;gt;100&amp;lt;/option&amp;gt;
        &amp;lt;option name="dataOverlayMode"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="percentagesRow"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
        &amp;lt;option name="rowNumbers"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="totalsRow"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="wrap"&amp;gt;true&amp;lt;/option&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/dashboard&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:19:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-highlight-table-cell-based-on-few-conditions/m-p/435932#M171604</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2020-09-30T00:19:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to highlight table cell based on few conditions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-highlight-table-cell-based-on-few-conditions/m-p/435933#M171605</link>
      <description>&lt;P&gt;nothing happens &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 May 2019 10:23:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-highlight-table-cell-based-on-few-conditions/m-p/435933#M171605</guid>
      <dc:creator>sarit_s</dc:creator>
      <dc:date>2019-05-01T10:23:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to highlight table cell based on few conditions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-highlight-table-cell-based-on-few-conditions/m-p/435934#M171606</link>
      <description>&lt;P&gt;@sarit_s&lt;/P&gt;

&lt;P&gt;Can you please share your code which you have tried?&lt;/P&gt;</description>
      <pubDate>Wed, 01 May 2019 10:30:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-highlight-table-cell-based-on-few-conditions/m-p/435934#M171606</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2019-05-01T10:30:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to highlight table cell based on few conditions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-highlight-table-cell-based-on-few-conditions/m-p/435935#M171607</link>
      <description>&lt;P&gt;js file : &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; require([
      'underscore',
      'jquery',
      'splunkjs/mvc',
      'splunkjs/mvc/tableview',
      'splunkjs/mvc/simplexml/ready!'
  ], function(_, $, mvc, TableView) {

      var CustomRangeRenderer = TableView.BaseCellRenderer.extend({
          canRender: function(cell) {
              return _(['HeadVoltage', 'Voltage_before_optimization', 'Layer']).contains(cell.field);
          },
          render: function($td, cell) {
             var cell_value = cell.value;
             var HeadVoltage = cell_value.split("|")[0];
             var Voltage_before_optimization = cell_value.split("|")[1];
             var Layer = cell_value.split("|")[2];
             if ((HeadVoltage &amp;gt; 29 OR Voltage_before_optimization &amp;gt; 29 ) &amp;amp;&amp;amp; Layer &amp;lt; 26)
             {
                 if (cell.field === 'HeadVoltage'){
                     $td.html("&amp;lt;div class='range-severe'&amp;gt;"+HeadVoltage+"&amp;lt;/div&amp;gt;")
                 } else if(cell.field === 'Voltage_before_optimization') {
                     $td.html("&amp;lt;div&amp;gt;"+Voltage_before_optimization+"&amp;lt;/div&amp;gt;")
                 } else if(cell.field === 'Layer') {
                     $td.html("&amp;lt;div class='range-severe'&amp;gt;"+Layer+"&amp;lt;/div&amp;gt;")
                 }
             }
          }
      });

      //List of table IDs to add icon
      var tableIDs = ["highlight"];
      for (i=0;i&amp;lt;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();
              });
          }
      }
  });
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;css:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; #highlight div.range-severe {
  background-color: #d59392 !important;
  font-weight: bold;
 }
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;xml:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form script="table_cell_highlighting2.js" stylesheet="table_cell_highlighting2.css"&amp;gt;
  &amp;lt;label&amp;gt;PJ J7 Heads Monitoring&amp;lt;/label&amp;gt;
  &amp;lt;fieldset submitButton="true" autoRun="false"&amp;gt;
    &amp;lt;input type="time" token="time" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;Time&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;
        &amp;lt;earliest&amp;gt;-30d@d&amp;lt;/earliest&amp;gt;
        &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
      &amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="text" token="SerialNumber"&amp;gt;
      &amp;lt;label&amp;gt;SerialNumber&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="text" token="HeadSerialNumber"&amp;gt;
      &amp;lt;label&amp;gt;HeadSerialNumber&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="text" token="Region"&amp;gt;
      &amp;lt;label&amp;gt;Region&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="text" token="HeadType"&amp;gt;
      &amp;lt;label&amp;gt;HeadType&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;table id="highlight"&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;(index=*_pj OR index=other) NOT source=*Bio_Mimics* 
(Head Optimization Wizard ((started) OR (ended) OR (was selected) OR (num of missing) OR (Save voltage) OR (Support voltage) OR (Model voltage) OR (Target layer Net))) OR
(("Serial Number") OR ("Head Type") OR ("Maintenance counter"))
|`SerialNumber`
| search SerialNumber=$SerialNumber$
|`Region`
| search Region=$Region$
|`PrinterType`
| rex "Serial Number = (?&amp;amp;lt;HeadSerialNumber&amp;amp;gt;\S+)"
| rex field=HeadSerialNumber mode=sed "s/,//"
| rex "Head Type = (?&amp;amp;lt;HeadType&amp;amp;gt;[\w\ ]+)"
| rex "Head Optimization Wizard: (?&amp;amp;lt;WizardMode&amp;amp;gt;\S+) was selected"
| rex "Nozzles for head Head (?&amp;amp;lt;head&amp;amp;gt;\d+) is (?&amp;amp;lt;missing_nozzles&amp;amp;gt;\d+)"
| rex "physical Head Index = (?&amp;amp;lt;head&amp;amp;gt;\d+)"
| rex "Save voltage (?&amp;amp;lt;Calibrated_voltage&amp;amp;gt;[\d\.]+) for head Head (?&amp;amp;lt;head&amp;amp;gt;\d+)"
| rex "Support voltage (?&amp;amp;lt;Voltage_before_optimization&amp;amp;gt;[\d\.]+) for head Head (?&amp;amp;lt;head&amp;amp;gt;\d+)"
| rex "Model voltage (?&amp;amp;lt;Voltage_before_optimization&amp;amp;gt;[\d\.]+) for head Head (?&amp;amp;lt;head&amp;amp;gt;\d+)"
| rex "Head Optimization Wizard: (?&amp;amp;lt;wizard_ended&amp;amp;gt;ended)"
| rex "Head Optimization Wizard: (?&amp;amp;lt;wizard_started&amp;amp;gt;started)"
| rex "Target layer Net\s+\=\s+(?&amp;amp;lt;Layer&amp;amp;gt;[\d\.]+)"
| eval startedTime=if(isnotnull(wizard_started),_time,null())
| eval startedSource=if(isnotnull(wizard_started),source,null())
| eval endedTime=if(isnotnull(wizard_ended),_time,null())
| eval endedSource=if(isnotnull(wizard_ended),source,null())
| rex "Maintenance counter \"H(?&amp;amp;lt;head&amp;amp;gt;\d+)\" Value is: (?&amp;amp;lt;head_lifetime&amp;amp;gt;\d+)"
| eventstats max(startedTime) as startedTime max(endedTime) as endedTime by SerialNumber
| where isnotnull(HeadSerialNumber) OR isnotnull(HeadType) OR (_time&amp;amp;gt;=startedTime AND _time&amp;amp;lt;=endedTime)
| sort 0 _time 
| streamstats last(Layer) as Layer  last(WizardMode) as WizardMode last(startedTime) as startedTime last(startedSource) as startedSource last(endedTime) as endedTime last(endedSource) as endedSource by SerialNumber
| stats last(endedSource) as endedSource last(startedSource) as startedSource max(startedTime) as startedTime max(endedTime) as endedTime last(*) as * by SerialNumber head
| search HeadSerialNumber=$HeadSerialNumber$ HeadType=$HeadType$
| lookup internal_Printers SN as SerialNumber OUTPUT  Type
| eval Internal=if(isnotnull(Type),"T","F")
| table startedTime endedTime Region Internal SerialNumber PrinterType head HeadSerialNumber HeadType missing_nozzles HeadVoltage HeadVoltageDate  Voltage_before_optimization Calibrated_voltage head_lifetime Layer WizardMode startedSource endedSource
| rename Calibrated_voltage as Calibrated_voltage_after_optimization

| join type=left Region SerialNumber MachineMode head 
    [search (index=*_pj OR index=other) source=*HQ.cfg OR source=*HM.cfg AND (RequestedHeadVoltagesSupport OR RequestedHeadVoltagesModel )
| `SerialNumber`
|`Region`
| rex field=source "PerMachine_(?&amp;amp;lt;WizardMode&amp;amp;gt;[^\.]+)" 
| eval WizardMode=if(WizardMode=="HM","HS/HM",WizardMode) 
| rex "RequestedHeadVoltagesSupport=(?&amp;amp;lt;head0&amp;amp;gt;[^,]+),(?&amp;amp;lt;head1&amp;amp;gt;[^,]+)," 
| rex "RequestedHeadVoltagesModel=[^,]+,[^,]+,(?&amp;amp;lt;head2&amp;amp;gt;[^,]+),(?&amp;amp;lt;head3&amp;amp;gt;[^,]+),(?&amp;amp;lt;head4&amp;amp;gt;[^,]+),(?&amp;amp;lt;head5&amp;amp;gt;[^,]+),(?&amp;amp;lt;head6&amp;amp;gt;[^,]+),(?&amp;amp;lt;head7&amp;amp;gt;[^,]+)"
| stats latest(*) as * max(_time) as headVoltageDate by SerialNumber Region
| table HeadVoltageDate Region SerialNumber WizardMode head*
| eval id=Region+"@"+SerialNumber+"@"+WizardMode+"@"+headVoltageDate
| table id head* 
| rename head* as *
| untable id head HeadVoltage
| eval id=split(id,"@")
| eval Region=mvindex(id,0)
| eval SerialNumber=mvindex(id,1)
| eval WizardMode=mvindex(id,2)
| eval HeadVoltageDate=mvindex(id,3)

| table  Region SerialNumber WizardMode head HeadVoltage HeadVoltageDate]
| convert ctime(endedTime) ctime(startedTime) ctime(HeadVoltageDate) timeformat="%F %T"&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;$time.earliest$&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;$time.latest$&amp;lt;/latest&amp;gt;
          &amp;lt;sampleRatio&amp;gt;1&amp;lt;/sampleRatio&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="count"&amp;gt;20&amp;lt;/option&amp;gt;
        &amp;lt;option name="dataOverlayMode"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="percentagesRow"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
        &amp;lt;option name="rowNumbers"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="totalsRow"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="wrap"&amp;gt;true&amp;lt;/option&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 01 May 2019 10:41:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-highlight-table-cell-based-on-few-conditions/m-p/435935#M171607</guid>
      <dc:creator>sarit_s</dc:creator>
      <dc:date>2019-05-01T10:41:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to highlight table cell based on few conditions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-highlight-table-cell-based-on-few-conditions/m-p/435936#M171608</link>
      <description>&lt;P&gt;@sarit_s&lt;/P&gt;

&lt;P&gt;Can you please add below search into table search and try again?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SEARCH IN XML | eval temp=HeadVoltage."|".Voltage_before_optimization."|".Layer,HeadVoltage=temp, Voltage_before_optimization=temp, Layer=temp | fields - temp
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 01 May 2019 11:02:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-highlight-table-cell-based-on-few-conditions/m-p/435936#M171608</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2019-05-01T11:02:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to highlight table cell based on few conditions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-highlight-table-cell-based-on-few-conditions/m-p/435937#M171609</link>
      <description>&lt;P&gt;this is my new xml:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form script="table_cell_highlighting2.js" stylesheet="table_cell_highlighting2.css"&amp;gt;
  &amp;lt;label&amp;gt;PJ J7 Heads Monitoring&amp;lt;/label&amp;gt;
  &amp;lt;fieldset submitButton="true" autoRun="false"&amp;gt;
    &amp;lt;input type="time" token="time" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;Time&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;
        &amp;lt;earliest&amp;gt;-30d@d&amp;lt;/earliest&amp;gt;
        &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
      &amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="text" token="SerialNumber"&amp;gt;
      &amp;lt;label&amp;gt;SerialNumber&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="text" token="HeadSerialNumber"&amp;gt;
      &amp;lt;label&amp;gt;HeadSerialNumber&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="text" token="Region"&amp;gt;
      &amp;lt;label&amp;gt;Region&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="text" token="HeadType"&amp;gt;
      &amp;lt;label&amp;gt;HeadType&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;table id="highlight"&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;(index=*_pj OR index=other) NOT source=*Bio_Mimics* 
(Head Optimization Wizard ((started) OR (ended) OR (was selected) OR (num of missing) OR (Save voltage) OR (Support voltage) OR (Model voltage) OR (Target layer Net))) OR
(("Serial Number") OR ("Head Type") OR ("Maintenance counter"))
|`SerialNumber`
| search SerialNumber=$SerialNumber$
|`Region`
| search Region=$Region$
|`PrinterType`
| rex "Serial Number = (?&amp;amp;lt;HeadSerialNumber&amp;amp;gt;\S+)"
| rex field=HeadSerialNumber mode=sed "s/,//"
| rex "Head Type = (?&amp;amp;lt;HeadType&amp;amp;gt;[\w\ ]+)"
| rex "Head Optimization Wizard: (?&amp;amp;lt;WizardMode&amp;amp;gt;\S+) was selected"
| rex "Nozzles for head Head (?&amp;amp;lt;head&amp;amp;gt;\d+) is (?&amp;amp;lt;missing_nozzles&amp;amp;gt;\d+)"
| rex "physical Head Index = (?&amp;amp;lt;head&amp;amp;gt;\d+)"
| rex "Save voltage (?&amp;amp;lt;Calibrated_voltage&amp;amp;gt;[\d\.]+) for head Head (?&amp;amp;lt;head&amp;amp;gt;\d+)"
| rex "Support voltage (?&amp;amp;lt;Voltage_before_optimization&amp;amp;gt;[\d\.]+) for head Head (?&amp;amp;lt;head&amp;amp;gt;\d+)"
| rex "Model voltage (?&amp;amp;lt;Voltage_before_optimization&amp;amp;gt;[\d\.]+) for head Head (?&amp;amp;lt;head&amp;amp;gt;\d+)"
| rex "Head Optimization Wizard: (?&amp;amp;lt;wizard_ended&amp;amp;gt;ended)"
| rex "Head Optimization Wizard: (?&amp;amp;lt;wizard_started&amp;amp;gt;started)"
| rex "Target layer Net\s+\=\s+(?&amp;amp;lt;Layer&amp;amp;gt;[\d\.]+)"
| eval startedTime=if(isnotnull(wizard_started),_time,null())
| eval startedSource=if(isnotnull(wizard_started),source,null())
| eval endedTime=if(isnotnull(wizard_ended),_time,null())
| eval endedSource=if(isnotnull(wizard_ended),source,null())
| rex "Maintenance counter \"H(?&amp;amp;lt;head&amp;amp;gt;\d+)\" Value is: (?&amp;amp;lt;head_lifetime&amp;amp;gt;\d+)"
| eventstats max(startedTime) as startedTime max(endedTime) as endedTime by SerialNumber
| where isnotnull(HeadSerialNumber) OR isnotnull(HeadType) OR (_time&amp;amp;gt;=startedTime AND _time&amp;amp;lt;=endedTime)
| sort 0 _time 
| streamstats last(Layer) as Layer  last(WizardMode) as WizardMode last(startedTime) as startedTime last(startedSource) as startedSource last(endedTime) as endedTime last(endedSource) as endedSource by SerialNumber
| stats last(endedSource) as endedSource last(startedSource) as startedSource max(startedTime) as startedTime max(endedTime) as endedTime last(*) as * by SerialNumber head
| search HeadSerialNumber=$HeadSerialNumber$ HeadType=$HeadType$
| lookup internal_Printers SN as SerialNumber OUTPUT  Type
| eval Internal=if(isnotnull(Type),"T","F")
| table startedTime endedTime Region Internal SerialNumber PrinterType head HeadSerialNumber HeadType missing_nozzles HeadVoltage HeadVoltageDate  Voltage_before_optimization Calibrated_voltage head_lifetime Layer WizardMode startedSource endedSource
| rename Calibrated_voltage as Calibrated_voltage_after_optimization

| join type=left Region SerialNumber MachineMode head 
    [search (index=*_pj OR index=other) source=*HQ.cfg OR source=*HM.cfg AND (RequestedHeadVoltagesSupport OR RequestedHeadVoltagesModel )
| `SerialNumber`
|`Region`
| rex field=source "PerMachine_(?&amp;amp;lt;WizardMode&amp;amp;gt;[^\.]+)" 
| eval WizardMode=if(WizardMode=="HM","HS/HM",WizardMode) 
| rex "RequestedHeadVoltagesSupport=(?&amp;amp;lt;head0&amp;amp;gt;[^,]+),(?&amp;amp;lt;head1&amp;amp;gt;[^,]+)," 
| rex "RequestedHeadVoltagesModel=[^,]+,[^,]+,(?&amp;amp;lt;head2&amp;amp;gt;[^,]+),(?&amp;amp;lt;head3&amp;amp;gt;[^,]+),(?&amp;amp;lt;head4&amp;amp;gt;[^,]+),(?&amp;amp;lt;head5&amp;amp;gt;[^,]+),(?&amp;amp;lt;head6&amp;amp;gt;[^,]+),(?&amp;amp;lt;head7&amp;amp;gt;[^,]+)"
| stats latest(*) as * max(_time) as headVoltageDate by SerialNumber Region
| table HeadVoltageDate Region SerialNumber WizardMode head*
| eval id=Region+"@"+SerialNumber+"@"+WizardMode+"@"+headVoltageDate
| table id head* 
| rename head* as *
| untable id head HeadVoltage
| eval id=split(id,"@")
| eval Region=mvindex(id,0)
| eval SerialNumber=mvindex(id,1)
| eval WizardMode=mvindex(id,2)
| eval HeadVoltageDate=mvindex(id,3)
| eval temp=HeadVoltage."|".Voltage_before_optimization."|".Layer,HeadVoltage=temp, Voltage_before_optimization=temp, Layer=temp | fields - temp
| table  Region SerialNumber WizardMode head HeadVoltage HeadVoltageDate]
| convert ctime(endedTime) ctime(startedTime) ctime(HeadVoltageDate) timeformat="%F %T"&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;$time.earliest$&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;$time.latest$&amp;lt;/latest&amp;gt;
          &amp;lt;sampleRatio&amp;gt;1&amp;lt;/sampleRatio&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="count"&amp;gt;20&amp;lt;/option&amp;gt;
        &amp;lt;option name="dataOverlayMode"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="percentagesRow"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
        &amp;lt;option name="rowNumbers"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="totalsRow"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="wrap"&amp;gt;true&amp;lt;/option&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;nothing happens and i lost data from HeadVoltage &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 May 2019 11:07:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-highlight-table-cell-based-on-few-conditions/m-p/435937#M171609</guid>
      <dc:creator>sarit_s</dc:creator>
      <dc:date>2019-05-01T11:07:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to highlight table cell based on few conditions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-highlight-table-cell-based-on-few-conditions/m-p/435938#M171610</link>
      <description>&lt;P&gt;Query should be like this.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt;query&amp;gt;(index=*_pj OR index=other) NOT source=*Bio_Mimics* 
 (Head Optimization Wizard ((started) OR (ended) OR (was selected) OR (num of missing) OR (Save voltage) OR (Support voltage) OR (Model voltage) OR (Target layer Net))) OR
 (("Serial Number") OR ("Head Type") OR ("Maintenance counter"))
 |`SerialNumber`
 | search SerialNumber=$SerialNumber$
 |`Region`
 | search Region=$Region$
 |`PrinterType`
 | rex "Serial Number = (?&amp;amp;lt;HeadSerialNumber&amp;amp;gt;\S+)"
 | rex field=HeadSerialNumber mode=sed "s/,//"
 | rex "Head Type = (?&amp;amp;lt;HeadType&amp;amp;gt;[\w\ ]+)"
 | rex "Head Optimization Wizard: (?&amp;amp;lt;WizardMode&amp;amp;gt;\S+) was selected"
 | rex "Nozzles for head Head (?&amp;amp;lt;head&amp;amp;gt;\d+) is (?&amp;amp;lt;missing_nozzles&amp;amp;gt;\d+)"
 | rex "physical Head Index = (?&amp;amp;lt;head&amp;amp;gt;\d+)"
 | rex "Save voltage (?&amp;amp;lt;Calibrated_voltage&amp;amp;gt;[\d\.]+) for head Head (?&amp;amp;lt;head&amp;amp;gt;\d+)"
 | rex "Support voltage (?&amp;amp;lt;Voltage_before_optimization&amp;amp;gt;[\d\.]+) for head Head (?&amp;amp;lt;head&amp;amp;gt;\d+)"
 | rex "Model voltage (?&amp;amp;lt;Voltage_before_optimization&amp;amp;gt;[\d\.]+) for head Head (?&amp;amp;lt;head&amp;amp;gt;\d+)"
 | rex "Head Optimization Wizard: (?&amp;amp;lt;wizard_ended&amp;amp;gt;ended)"
 | rex "Head Optimization Wizard: (?&amp;amp;lt;wizard_started&amp;amp;gt;started)"
 | rex "Target layer Net\s+\=\s+(?&amp;amp;lt;Layer&amp;amp;gt;[\d\.]+)"
 | eval startedTime=if(isnotnull(wizard_started),_time,null())
 | eval startedSource=if(isnotnull(wizard_started),source,null())
 | eval endedTime=if(isnotnull(wizard_ended),_time,null())
 | eval endedSource=if(isnotnull(wizard_ended),source,null())
 | rex "Maintenance counter \"H(?&amp;amp;lt;head&amp;amp;gt;\d+)\" Value is: (?&amp;amp;lt;head_lifetime&amp;amp;gt;\d+)"
 | eventstats max(startedTime) as startedTime max(endedTime) as endedTime by SerialNumber
 | where isnotnull(HeadSerialNumber) OR isnotnull(HeadType) OR (_time&amp;amp;gt;=startedTime AND _time&amp;amp;lt;=endedTime)
 | sort 0 _time 
 | streamstats last(Layer) as Layer  last(WizardMode) as WizardMode last(startedTime) as startedTime last(startedSource) as startedSource last(endedTime) as endedTime last(endedSource) as endedSource by SerialNumber
 | stats last(endedSource) as endedSource last(startedSource) as startedSource max(startedTime) as startedTime max(endedTime) as endedTime last(*) as * by SerialNumber head
 | search HeadSerialNumber=$HeadSerialNumber$ HeadType=$HeadType$
 | lookup internal_Printers SN as SerialNumber OUTPUT  Type
 | eval Internal=if(isnotnull(Type),"T","F")
 | table startedTime endedTime Region Internal SerialNumber PrinterType head HeadSerialNumber HeadType missing_nozzles HeadVoltage HeadVoltageDate  Voltage_before_optimization Calibrated_voltage head_lifetime Layer WizardMode startedSource endedSource
 | rename Calibrated_voltage as Calibrated_voltage_after_optimization

 | join type=left Region SerialNumber MachineMode head 
     [search (index=*_pj OR index=other) source=*HQ.cfg OR source=*HM.cfg AND (RequestedHeadVoltagesSupport OR RequestedHeadVoltagesModel )
 | `SerialNumber`
 |`Region`
 | rex field=source "PerMachine_(?&amp;amp;lt;WizardMode&amp;amp;gt;[^\.]+)" 
 | eval WizardMode=if(WizardMode=="HM","HS/HM",WizardMode) 
 | rex "RequestedHeadVoltagesSupport=(?&amp;amp;lt;head0&amp;amp;gt;[^,]+),(?&amp;amp;lt;head1&amp;amp;gt;[^,]+)," 
 | rex "RequestedHeadVoltagesModel=[^,]+,[^,]+,(?&amp;amp;lt;head2&amp;amp;gt;[^,]+),(?&amp;amp;lt;head3&amp;amp;gt;[^,]+),(?&amp;amp;lt;head4&amp;amp;gt;[^,]+),(?&amp;amp;lt;head5&amp;amp;gt;[^,]+),(?&amp;amp;lt;head6&amp;amp;gt;[^,]+),(?&amp;amp;lt;head7&amp;amp;gt;[^,]+)"
 | stats latest(*) as * max(_time) as headVoltageDate by SerialNumber Region
 | table HeadVoltageDate Region SerialNumber WizardMode head*
 | eval id=Region+"@"+SerialNumber+"@"+WizardMode+"@"+headVoltageDate
 | table id head* 
 | rename head* as *
 | untable id head HeadVoltage
 | eval id=split(id,"@")
 | eval Region=mvindex(id,0)
 | eval SerialNumber=mvindex(id,1)
 | eval WizardMode=mvindex(id,2)
 | eval HeadVoltageDate=mvindex(id,3)
 | table  Region SerialNumber WizardMode head HeadVoltage HeadVoltageDate]
 | convert ctime(endedTime) ctime(startedTime) ctime(HeadVoltageDate) timeformat="%F %T"
| eval temp=HeadVoltage."|".Voltage_before_optimization."|".Layer,HeadVoltage=temp, Voltage_before_optimization=temp, Layer=temp | fields - temp &amp;lt;/query&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 01 May 2019 11:33:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-highlight-table-cell-based-on-few-conditions/m-p/435938#M171610</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2019-05-01T11:33:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to highlight table cell based on few conditions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-highlight-table-cell-based-on-few-conditions/m-p/435939#M171611</link>
      <description>&lt;P&gt;it returns the values in the relevant field with | delimiter&lt;BR /&gt;
not coloring anything and merge field results.. &lt;/P&gt;</description>
      <pubDate>Wed, 01 May 2019 12:01:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-highlight-table-cell-based-on-few-conditions/m-p/435939#M171611</guid>
      <dc:creator>sarit_s</dc:creator>
      <dc:date>2019-05-01T12:01:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to highlight table cell based on few conditions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-highlight-table-cell-based-on-few-conditions/m-p/435940#M171612</link>
      <description>&lt;P&gt;Merging fields is expected. Can you please pul some consoles in javascript in render function??&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;console.log(" some console log");&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;I hope you are _bump the version on your Splunk instance. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Basically, render function should work properly and display specific value along with the colour. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;/P&gt;</description>
      <pubDate>Wed, 01 May 2019 12:09:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-highlight-table-cell-based-on-few-conditions/m-p/435940#M171612</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2019-05-01T12:09:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to highlight table cell based on few conditions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-highlight-table-cell-based-on-few-conditions/m-p/435941#M171613</link>
      <description>&lt;P&gt;i have same problem. Anyone Tell me if it solved.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Aug 2019 07:55:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-highlight-table-cell-based-on-few-conditions/m-p/435941#M171613</guid>
      <dc:creator>dailv1808</dc:creator>
      <dc:date>2019-08-23T07:55:25Z</dc:date>
    </item>
  </channel>
</rss>

