<?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: Is it possible to highlight a value within a multi-value cell? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-highlight-a-value-within-a-multi-value-cell/m-p/567262#M46588</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/201110"&gt;@niketn&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;this is a very interesting post. I have a similar task (but my mv values are simple text, no dates or timestamps), and I'm wondering whether it would possible to achieve such a mv value highlighting even without JavaScript?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 16 Sep 2021 14:16:15 GMT</pubDate>
    <dc:creator>Pamela</dc:creator>
    <dc:date>2021-09-16T14:16:15Z</dc:date>
    <item>
      <title>Is it possible to highlight a value within a multi-value cell?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-highlight-a-value-within-a-multi-value-cell/m-p/443532#M33010</link>
      <description>&lt;P&gt;I am monitoring jobs that run multiple times a day. The query returns the times the job runs per day.&lt;BR /&gt;&lt;BR /&gt;Here's an example of how the multi-value field looks.&lt;BR /&gt;4:40:32&lt;BR /&gt;8:32:55&lt;BR /&gt;12:51:40&lt;BR /&gt;16:01:03&lt;/P&gt;
&lt;P&gt;I want to highlight 4:40:32 green, since it completed before 5:00, then highlight 16:01:03 red because it completed after 16:00.&lt;BR /&gt;Is it possible to highlight certain values within a cell?&lt;/P&gt;</description>
      <pubDate>Sun, 07 Jun 2020 23:28:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-highlight-a-value-within-a-multi-value-cell/m-p/443532#M33010</guid>
      <dc:creator>cmcdole</dc:creator>
      <dc:date>2020-06-07T23:28:45Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to highlight a value within a multi-value cell?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-highlight-a-value-within-a-multi-value-cell/m-p/443533#M33011</link>
      <description>&lt;P&gt;If you try to do this in a dashboard you should look for "splunk cell renderer"&lt;BR /&gt;
 or if you don´t want to write java script for that, you can use the build in function on dashboards for color ranges.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Oct 2018 11:29:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-highlight-a-value-within-a-multi-value-cell/m-p/443533#M33011</guid>
      <dc:creator>dkeck</dc:creator>
      <dc:date>2018-10-24T11:29:54Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to highlight a value within a multi-value cell?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-highlight-a-value-within-a-multi-value-cell/m-p/443534#M33012</link>
      <description>&lt;P&gt;@cmcdole try the following approach with TableView to capture table render event (Splunk 6.6 and above require setTimeout() to ensure table is rendered completely). Then it uses jQuery selector to iterate through multiple values in the multi-valued field using &lt;CODE&gt;each()&lt;/CODE&gt; function.&lt;BR /&gt;
PS: This run any where example assumes Multi-valued field is 2nd column &lt;CODE&gt;data&lt;/CODE&gt; i.e. at the index of &lt;CODE&gt;1&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;Following is the jQuery selector provided table in Simple XML has &lt;CODE&gt;id="highlight"&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;div#highlight table td[data-cell-index="1"] div.multivalue-subcell'
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/5978iA1CE287DFD24EA8E/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Following is the Run anywhere Simple XML Dashboard Code. PS: Since the example performs a string comparison in JavaScript your search result would need to ensure that Time is always in HH:MM:SS format i.e. &lt;CODE&gt;04:01:20&lt;/CODE&gt; and &lt;CODE&gt;not 4:02:20 etc&lt;/CODE&gt;. Or else you would need to perform Date Time based conversion/calculation in JS.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;dashboard script="table_multivalue_highlight.js"&amp;gt;
  &amp;lt;label&amp;gt;Table with Multivalue&amp;lt;/label&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;html&amp;gt;
        &amp;lt;style&amp;gt;
            .highlight-green{
                background:green;
            }
            .highlight-yellow{
                background:yellow;
            }
            .highlight-red{
                background:red;
            }          
        &amp;lt;/style&amp;gt;
      &amp;lt;/html&amp;gt;
      &amp;lt;table id="highlight"&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;| makeresults
| eval data="04:40:32;08:32:55;12:51:40;16:01:03"
| makemv data delim=";"&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;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="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;

&lt;P&gt;Following is the required JavaScript file ( &lt;CODE&gt;table_multivalue_highlight.js&lt;/CODE&gt; )&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;require([
    'underscore',
    'jquery',
    'splunkjs/mvc',
    'splunkjs/mvc/tableview',
    'splunkjs/mvc/simplexml/ready!'
], function(_, $, mvc, TableView) {
    mvc.Components.get('highlight').getVisualization(function(tableView) {
        tableView.on('rendered', function() {
             setTimeout(function(){ 
                $('div#highlight table td[data-cell-index="1"] div.multivalue-subcell') .each(function(){
                    var strMultiValueTest=$(this).text();
                    if(strMultiValueTest&amp;lt;"05:00:00"){
                        $(this).addClass("highlight-green");
                    }
                    else if(strMultiValueTest&amp;gt;="05:00:00" &amp;amp;&amp;amp; strMultiValueTest&amp;lt;="16:00:00"){
                        $(this).addClass("highlight-yellow");
                    }else{
                        $(this).addClass("highlight-red");
                    }   
                }); 
             },100);
        });
    });
});
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 24 Oct 2018 21:48:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-highlight-a-value-within-a-multi-value-cell/m-p/443534#M33012</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-10-24T21:48:47Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to highlight a value within a multi-value cell?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-highlight-a-value-within-a-multi-value-cell/m-p/443535#M33013</link>
      <description>&lt;P&gt;Thanks for this solution, it works well for me.&lt;/P&gt;

&lt;P&gt;Do you have any idea how this code could be tweaked so that it would highlight single value cells also?&lt;BR /&gt;
I have a table that could have multi-value cells or single value cells.&lt;/P&gt;</description>
      <pubDate>Thu, 07 May 2020 16:06:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-highlight-a-value-within-a-multi-value-cell/m-p/443535#M33013</guid>
      <dc:creator>richielynch89</dc:creator>
      <dc:date>2020-05-07T16:06:54Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to highlight a value within a multi-value cell?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-highlight-a-value-within-a-multi-value-cell/m-p/443536#M33014</link>
      <description>&lt;P&gt;@richielynch89 above is a generic example for Cell Rendering for multivalued-cells within table. If you want specific rendering depending on cell type you will have to pass on the cell field names and take actions accordingly. Following is an example of Table Cell rendering extension: &lt;A href="https://answers.splunk.com/answers/637615/why-is-the-table-cell-highlighting-not-reading-the.html"&gt;https://answers.splunk.com/answers/637615/why-is-the-table-cell-highlighting-not-reading-the.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;You Should also check out Splunk Dashboard Examples app from Splunkbase for getting familier with Splunk JS Stack and Simple XML JS Extensions.&lt;/P&gt;</description>
      <pubDate>Mon, 11 May 2020 06:54:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-highlight-a-value-within-a-multi-value-cell/m-p/443536#M33014</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2020-05-11T06:54:08Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to highlight a value within a multi-value cell?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-highlight-a-value-within-a-multi-value-cell/m-p/443537#M33015</link>
      <description>&lt;P&gt;@niketnilay Yes, I also tried to get it working using the method you advised in the link you pasted above which only works with single value cells.&lt;BR /&gt;
My problem is that I don't know whether a table cell will have multiple values or a single value in it.&lt;BR /&gt;
When I use your code to highlight cells that have multiple values then it works perfectly but if, in the same table a cell has a single value then it will not highlight the value.&lt;BR /&gt;
This is because the code is expecting to see a multi-value field.&lt;/P&gt;

&lt;P&gt;If I take the approach from the link you pasted above which highlights single value cells then it will work fine for single value cells in my table but it doesn't work for multiple value cells that I have in the table.&lt;/P&gt;

&lt;P&gt;I've tried taking code from both js scripts but I've had no luck so far.&lt;/P&gt;

&lt;P&gt;Did you ever write a script that can highlight a table cell if has either multiple values in it or a single value in the cell?&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jun 2020 15:20:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-highlight-a-value-within-a-multi-value-cell/m-p/443537#M33015</guid>
      <dc:creator>richielynch89</dc:creator>
      <dc:date>2020-06-04T15:20:24Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to highlight a value within a multi-value cell?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-highlight-a-value-within-a-multi-value-cell/m-p/507259#M33730</link>
      <description>&lt;P&gt;If anybody else has table cells that can either be multi-value or single value, you may also have highlighting issues.&lt;/P&gt;&lt;P&gt;I used a workaround to append "+ " (that's a blank space after the plus sign) to single value cell and then I split the string by "+" to turn it into a multi-value cell.&lt;/P&gt;&lt;P&gt;The first value is the initial value and the 2nd value is a blank space&lt;/P&gt;&lt;P&gt;In javascript then you can write a condition so that cells that are equal to " " will not be highlighted.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jul 2020 14:15:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-highlight-a-value-within-a-multi-value-cell/m-p/507259#M33730</guid>
      <dc:creator>richielynch89</dc:creator>
      <dc:date>2020-07-03T14:15:33Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to highlight a value within a multi-value cell?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-highlight-a-value-within-a-multi-value-cell/m-p/507270#M33734</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/116156"&gt;@richielynch89&lt;/a&gt;&amp;nbsp;I have posted a reply to your other question. Can you please try and confirm?&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-highlight-table-cells-that-can-either-be-multi-value/m-p/471787#M30971" target="_blank"&gt;https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-highlight-table-cells-that-can-either-be-multi-value/m-p/471787#M30971&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jul 2020 15:25:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-highlight-a-value-within-a-multi-value-cell/m-p/507270#M33734</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2020-07-03T15:25:05Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to highlight a value within a multi-value cell?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-highlight-a-value-within-a-multi-value-cell/m-p/522875#M35312</link>
      <description>&lt;P&gt;This was extremely useful for me in a similar use case. Thanks for taking the time to post!&lt;/P&gt;</description>
      <pubDate>Sun, 04 Oct 2020 21:42:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-highlight-a-value-within-a-multi-value-cell/m-p/522875#M35312</guid>
      <dc:creator>shocko</dc:creator>
      <dc:date>2020-10-04T21:42:42Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to highlight a value within a multi-value cell?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-highlight-a-value-within-a-multi-value-cell/m-p/567262#M46588</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/201110"&gt;@niketn&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;this is a very interesting post. I have a similar task (but my mv values are simple text, no dates or timestamps), and I'm wondering whether it would possible to achieve such a mv value highlighting even without JavaScript?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Sep 2021 14:16:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-highlight-a-value-within-a-multi-value-cell/m-p/567262#M46588</guid>
      <dc:creator>Pamela</dc:creator>
      <dc:date>2021-09-16T14:16:15Z</dc:date>
    </item>
  </channel>
</rss>

