<?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: Highlight Each Row In Table Based On Conditions in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Highlight-Each-Row-In-Table-Based-On-Conditions/m-p/474423#M31145</link>
    <description>&lt;P&gt;@tyhopping1, I dont think that would be possible without JS Extension. Community will be able to assist you with JS/CSS based solution if possible. Let us know! You can also refer to one of my older answers for highlighting row based on duration: &lt;A href="https://answers.splunk.com/answers/581747/change-row-color-when-the-field-time-value-increas.html"&gt;https://answers.splunk.com/answers/581747/change-row-color-when-the-field-time-value-increas.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;If you just need to show Job Name with color based on Actual Start Time vs Expected Start Time you can also check out Status Indicator Custom visualization with some CSS Override it can output like the following:&lt;/P&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/8415i58D88F18DF438F0E/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 example SimpleXML code (CSS Override done from within SImple XML):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;dashboard&amp;gt;
  &amp;lt;label&amp;gt;Status Indicator Trellis&amp;lt;/label&amp;gt;
  &amp;lt;description&amp;gt;Color Job by delay in Actual Start vs Expected Start Status Indicator Trellis&amp;lt;/description&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;html&amp;gt;
        &amp;lt;style&amp;gt;
          #my_status_indicator1 .facet-label{
            position: relative !important;
            top: 90px !important;
            font-size: xx-large !important;
            color: white !important;
          }
          #my_status_indicator1 div[id="status_indicator_app.status_indicator"].splunk-status-indicator{
            font-size: 0px !important;
          }
          #my_status_indicator1 div[id="status_indicator_app.status_indicator"].lazy-custom-visualization{
            height: 80% !important;
          }
        &amp;lt;/style&amp;gt;
      &amp;lt;/html&amp;gt;
      &amp;lt;viz id="my_status_indicator1" type="status_indicator_app.status_indicator"&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;| makeresults count=20
| streamstats count as sno 
| eval msg.jobName="Job".sno 
| eval StartTime=random(),StartTime="-".substr(StartTime,1,1) 
| eval ExpectedStartTime=random(),ExpectedStartTime="-".substr(ExpectedStartTime,1,1) 
| eval ActualStart=relative_time(now(),StartTime),
    ExpectedStart=relative_time(now(),ExpectedStartTime) 
| eval diff=round(ActualStart-ExpectedStart,0) 
| table msg.jobName diff
| stats last(diff) as diff by msg.jobName
| eval color=if(diff&amp;gt;=0,"#53a051","#dc4e41")&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="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="height"&amp;gt;675&amp;lt;/option&amp;gt;
        &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
        &amp;lt;option name="status_indicator_app.status_indicator.colorBy"&amp;gt;field_value&amp;lt;/option&amp;gt;
        &amp;lt;option name="status_indicator_app.status_indicator.fillTarget"&amp;gt;background&amp;lt;/option&amp;gt;
        &amp;lt;option name="status_indicator_app.status_indicator.fixIcon"&amp;gt;warning&amp;lt;/option&amp;gt;
        &amp;lt;option name="status_indicator_app.status_indicator.icon"&amp;gt;field_value&amp;lt;/option&amp;gt;
        &amp;lt;option name="status_indicator_app.status_indicator.precision"&amp;gt;0&amp;lt;/option&amp;gt;
        &amp;lt;option name="status_indicator_app.status_indicator.showOption"&amp;gt;3&amp;lt;/option&amp;gt;
        &amp;lt;option name="status_indicator_app.status_indicator.staticColor"&amp;gt;#dc4e41&amp;lt;/option&amp;gt;
        &amp;lt;option name="status_indicator_app.status_indicator.useColors"&amp;gt;true&amp;lt;/option&amp;gt;
        &amp;lt;option name="status_indicator_app.status_indicator.useThousandSeparator"&amp;gt;true&amp;lt;/option&amp;gt;
        &amp;lt;option name="trellis.enabled"&amp;gt;1&amp;lt;/option&amp;gt;
        &amp;lt;option name="trellis.scales.shared"&amp;gt;1&amp;lt;/option&amp;gt;
        &amp;lt;option name="trellis.size"&amp;gt;small&amp;lt;/option&amp;gt;
      &amp;lt;/viz&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>Thu, 20 Feb 2020 14:02:56 GMT</pubDate>
    <dc:creator>niketn</dc:creator>
    <dc:date>2020-02-20T14:02:56Z</dc:date>
    <item>
      <title>Highlight Each Row In Table Based On Conditions</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Highlight-Each-Row-In-Table-Based-On-Conditions/m-p/474422#M31144</link>
      <description>&lt;P&gt;This is a continuation of: &lt;BR /&gt;
(&lt;A href="https://answers.splunk.com/answers/804476/compare-the-actual-start-time-to-the-expect-start.html"&gt;https://answers.splunk.com/answers/804476/compare-the-actual-start-time-to-the-expect-start.html&lt;/A&gt;)&lt;/P&gt;

&lt;P&gt;I have created a dashboard that compares the &lt;STRONG&gt;Actual Start Time&lt;/STRONG&gt; with the &lt;STRONG&gt;Expected Start Time&lt;/STRONG&gt; of a given job. In this dashboard, I would like these highlight conditions to be in effect:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;job ran on-time (Act. &amp;lt;= Exp.) = highlight green&lt;/LI&gt;
&lt;LI&gt;job has not ran yet  = highlight yellow&lt;/LI&gt;
&lt;LI&gt;job ran late (Act. &amp;gt; Exp.) = highlight red&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;I would like each row (each job name) highlighted based on these conditions.&lt;/P&gt;

&lt;P&gt;Here is the code for my current Dashboard:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;dashboard&amp;gt;
  &amp;lt;label&amp;gt;Name&amp;lt;/label&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;title&amp;gt;Title&amp;lt;/title&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;title&amp;gt;Title&amp;lt;/title&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;msg.jobName = RLMMTP* | spath "msg.status.Code" | search "msg.status.Code"=*| spath "msg.recordType" | search "msg.Type"=* | spath "msg.message" | search "msg.message"="RECORD PROCESSED" 
| eval day = strftime(_time, "%d")          
 | stats earliest(timestamp) as startTime, latest(timestamp) as endTime count by msg.jobName
 | eval startTime=substr(startTime,1,13) 
 | eval ActualStart=strftime(startTime/1000, "%H:%M:%S")
 | lookup AverageStartTimes.csv msg.jobName as msg.jobName OUTPUT ExpectedStart
 | table msg.jobName&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-1d@d&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;@d&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;format type="color" field="msg.jobName"&amp;gt;
          &amp;lt;colorPalette type="expression"&amp;gt;
            if ( ActualStart &amp;gt;= ExpectedStart, "#65A637")
            if ( ActualStart &amp;lt; ExpectedStart, "#8B0000")
          &amp;lt;/colorPalette&amp;gt;
        &amp;lt;/format&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;Upon trying with just simple XML in the Dashboard, it seems I cannot create a condition to highlight only one row at a time, only the whole column.  Unfortunately using JS and CSS is currently unavailable for me. Any help is appreciated. &lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2020 18:08:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Highlight-Each-Row-In-Table-Based-On-Conditions/m-p/474422#M31144</guid>
      <dc:creator>tyhopping1</dc:creator>
      <dc:date>2020-02-19T18:08:27Z</dc:date>
    </item>
    <item>
      <title>Re: Highlight Each Row In Table Based On Conditions</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Highlight-Each-Row-In-Table-Based-On-Conditions/m-p/474423#M31145</link>
      <description>&lt;P&gt;@tyhopping1, I dont think that would be possible without JS Extension. Community will be able to assist you with JS/CSS based solution if possible. Let us know! You can also refer to one of my older answers for highlighting row based on duration: &lt;A href="https://answers.splunk.com/answers/581747/change-row-color-when-the-field-time-value-increas.html"&gt;https://answers.splunk.com/answers/581747/change-row-color-when-the-field-time-value-increas.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;If you just need to show Job Name with color based on Actual Start Time vs Expected Start Time you can also check out Status Indicator Custom visualization with some CSS Override it can output like the following:&lt;/P&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/8415i58D88F18DF438F0E/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 example SimpleXML code (CSS Override done from within SImple XML):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;dashboard&amp;gt;
  &amp;lt;label&amp;gt;Status Indicator Trellis&amp;lt;/label&amp;gt;
  &amp;lt;description&amp;gt;Color Job by delay in Actual Start vs Expected Start Status Indicator Trellis&amp;lt;/description&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;html&amp;gt;
        &amp;lt;style&amp;gt;
          #my_status_indicator1 .facet-label{
            position: relative !important;
            top: 90px !important;
            font-size: xx-large !important;
            color: white !important;
          }
          #my_status_indicator1 div[id="status_indicator_app.status_indicator"].splunk-status-indicator{
            font-size: 0px !important;
          }
          #my_status_indicator1 div[id="status_indicator_app.status_indicator"].lazy-custom-visualization{
            height: 80% !important;
          }
        &amp;lt;/style&amp;gt;
      &amp;lt;/html&amp;gt;
      &amp;lt;viz id="my_status_indicator1" type="status_indicator_app.status_indicator"&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;| makeresults count=20
| streamstats count as sno 
| eval msg.jobName="Job".sno 
| eval StartTime=random(),StartTime="-".substr(StartTime,1,1) 
| eval ExpectedStartTime=random(),ExpectedStartTime="-".substr(ExpectedStartTime,1,1) 
| eval ActualStart=relative_time(now(),StartTime),
    ExpectedStart=relative_time(now(),ExpectedStartTime) 
| eval diff=round(ActualStart-ExpectedStart,0) 
| table msg.jobName diff
| stats last(diff) as diff by msg.jobName
| eval color=if(diff&amp;gt;=0,"#53a051","#dc4e41")&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="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="height"&amp;gt;675&amp;lt;/option&amp;gt;
        &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
        &amp;lt;option name="status_indicator_app.status_indicator.colorBy"&amp;gt;field_value&amp;lt;/option&amp;gt;
        &amp;lt;option name="status_indicator_app.status_indicator.fillTarget"&amp;gt;background&amp;lt;/option&amp;gt;
        &amp;lt;option name="status_indicator_app.status_indicator.fixIcon"&amp;gt;warning&amp;lt;/option&amp;gt;
        &amp;lt;option name="status_indicator_app.status_indicator.icon"&amp;gt;field_value&amp;lt;/option&amp;gt;
        &amp;lt;option name="status_indicator_app.status_indicator.precision"&amp;gt;0&amp;lt;/option&amp;gt;
        &amp;lt;option name="status_indicator_app.status_indicator.showOption"&amp;gt;3&amp;lt;/option&amp;gt;
        &amp;lt;option name="status_indicator_app.status_indicator.staticColor"&amp;gt;#dc4e41&amp;lt;/option&amp;gt;
        &amp;lt;option name="status_indicator_app.status_indicator.useColors"&amp;gt;true&amp;lt;/option&amp;gt;
        &amp;lt;option name="status_indicator_app.status_indicator.useThousandSeparator"&amp;gt;true&amp;lt;/option&amp;gt;
        &amp;lt;option name="trellis.enabled"&amp;gt;1&amp;lt;/option&amp;gt;
        &amp;lt;option name="trellis.scales.shared"&amp;gt;1&amp;lt;/option&amp;gt;
        &amp;lt;option name="trellis.size"&amp;gt;small&amp;lt;/option&amp;gt;
      &amp;lt;/viz&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>Thu, 20 Feb 2020 14:02:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Highlight-Each-Row-In-Table-Based-On-Conditions/m-p/474423#M31145</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2020-02-20T14:02:56Z</dc:date>
    </item>
    <item>
      <title>Re: Highlight Each Row In Table Based On Conditions</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Highlight-Each-Row-In-Table-Based-On-Conditions/m-p/474424#M31146</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;&amp;lt;query&amp;gt;msg.jobName="RLMMTP*" "\"message"\" "\"RECORD PROCESSED"\"
| spath msg.jobName
| eval day = strftime(_time, "%d") 
| stats earliest(timestamp) as startTime, latest(timestamp) as endTime count by "msg.jobName" 
| eval startTime=substr(startTime,1,13) 
| eval ActualStart=strftime(startTime/1000, "%H:%M:%S") 
| lookup AverageStartTimes.csv msg.jobName as msg.jobName OUTPUT ExpectedStart 
| stats values(AcutualStart) as ActualStart values(ExpectedStart) as ExpectedStart by "msg.jobName"&amp;lt;/query&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;maybe, it can be trellis visualization.&lt;/P&gt;</description>
      <pubDate>Sat, 22 Feb 2020 05:44:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Highlight-Each-Row-In-Table-Based-On-Conditions/m-p/474424#M31146</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-02-22T05:44:22Z</dc:date>
    </item>
  </channel>
</rss>

