<?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: Color the Table Cell based on inputlookup variable in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Color-the-Table-Cell-based-on-inputlookup-variable/m-p/407958#M26757</link>
    <description>&lt;P&gt;also with constant works correct&lt;BR /&gt;
.... if (value &amp;gt; &lt;STRONG&gt;0.01&lt;/STRONG&gt;, .....&lt;/P&gt;</description>
    <pubDate>Fri, 18 Jan 2019 04:42:11 GMT</pubDate>
    <dc:creator>vyulun</dc:creator>
    <dc:date>2019-01-18T04:42:11Z</dc:date>
    <item>
      <title>Color the Table Cell based on inputlookup variable</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Color-the-Table-Cell-based-on-inputlookup-variable/m-p/407955#M26754</link>
      <description>&lt;P&gt;Hi.&lt;BR /&gt;
I have next script panel. I have saved limit values to csv. For ex. gc_perc90_standart=0.01. I need to color cell in green if value &amp;lt; 0.01 and red if more. But problem here -  if (&lt;STRONG&gt;value &amp;gt; gc_perc90_standart&lt;/STRONG&gt;, "#53A051", "#DC4E41")&lt;BR /&gt;
How I should use variable within colorPalette?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;panel depends="$tok_GC_statistic$"&amp;gt;
      &amp;lt;title&amp;gt;GC statistics in seconds&amp;lt;/title&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;
                      index="all" source="*/log/gc_log_memory.log"
                        | rex "Total time for which application threads were stopped:\s(?&amp;lt;GC_TIME_THREADS&amp;gt;[0-9]+\.{0,1}[0-9]*)\sseconds"
                        | stats count(GC_TIME_THREADS) as cntGC, perc90(GC_TIME_THREADS) as proc90GC by host                    
                        | join type=inner
                        [                    
                           | inputlookup gc_standarts.csv | fields gc_perc90_standart
                        ]                    
                        | table host cntGC proc90GC gc_perc90_standart
                    &amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;$TimeToken.earliest$&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;$TimeToken.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="drilldown"&amp;gt;cell&amp;lt;/option&amp;gt;
        &amp;lt;format type="color" field=proc90GC &amp;gt;
          &amp;lt;colorPalette type="expression"&amp;gt;if (value &amp;gt; gc_perc90_standart, "#53A051", "#DC4E41")&amp;lt;/colorPalette&amp;gt;
        &amp;lt;/format&amp;gt;
        &amp;lt;drilldown&amp;gt;none&amp;lt;/drilldown&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:47:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Color-the-Table-Cell-based-on-inputlookup-variable/m-p/407955#M26754</guid>
      <dc:creator>vyulun</dc:creator>
      <dc:date>2020-09-29T22:47:37Z</dc:date>
    </item>
    <item>
      <title>Re: Color the Table Cell based on inputlookup variable</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Color-the-Table-Cell-based-on-inputlookup-variable/m-p/407956#M26755</link>
      <description>&lt;P&gt;@vyulun &lt;/P&gt;

&lt;P&gt;Can you please try this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;     &amp;lt;format type="color" field=proc90GC &amp;gt;
       &amp;lt;colorPalette type="expression"&amp;gt;if (value &amp;gt; 'gc_perc90_standart', "#53A051", "#DC4E41")&amp;lt;/colorPalette&amp;gt;
     &amp;lt;/format&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;My Sample Code :&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;dashboard&amp;gt;
  &amp;lt;label&amp;gt;test&amp;lt;/label&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;index=main |stats count by sourcetype | eval step=20000&amp;lt;/query&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;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;row&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="wrap"&amp;gt;true&amp;lt;/option&amp;gt;
        &amp;lt;format type="color" field="count"&amp;gt;
          &amp;lt;colorPalette type="expression"&amp;gt;if (value &amp;gt; 'step',"#FF5733","#247bc1")&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;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jan 2019 13:33:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Color-the-Table-Cell-based-on-inputlookup-variable/m-p/407956#M26755</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2019-01-17T13:33:44Z</dc:date>
    </item>
    <item>
      <title>Re: Color the Table Cell based on inputlookup variable</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Color-the-Table-Cell-based-on-inputlookup-variable/m-p/407957#M26756</link>
      <description>&lt;P&gt;Hi, kamlesh_vaghela. Thx for help. But, unfortunatelly, not resolve my problem. All values are red. Maybe because  gc_perc90_standart is float value == 0.01? &lt;BR /&gt;
Splunk version 7.1.2.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:48:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Color-the-Table-Cell-based-on-inputlookup-variable/m-p/407957#M26756</guid>
      <dc:creator>vyulun</dc:creator>
      <dc:date>2020-09-29T22:48:10Z</dc:date>
    </item>
    <item>
      <title>Re: Color the Table Cell based on inputlookup variable</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Color-the-Table-Cell-based-on-inputlookup-variable/m-p/407958#M26757</link>
      <description>&lt;P&gt;also with constant works correct&lt;BR /&gt;
.... if (value &amp;gt; &lt;STRONG&gt;0.01&lt;/STRONG&gt;, .....&lt;/P&gt;</description>
      <pubDate>Fri, 18 Jan 2019 04:42:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Color-the-Table-Cell-based-on-inputlookup-variable/m-p/407958#M26757</guid>
      <dc:creator>vyulun</dc:creator>
      <dc:date>2019-01-18T04:42:11Z</dc:date>
    </item>
    <item>
      <title>Re: Color the Table Cell based on inputlookup variable</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Color-the-Table-Cell-based-on-inputlookup-variable/m-p/407959#M26758</link>
      <description>&lt;P&gt;I have made experiment with integers (1 2 3...), but the same problems&lt;/P&gt;</description>
      <pubDate>Fri, 18 Jan 2019 05:15:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Color-the-Table-Cell-based-on-inputlookup-variable/m-p/407959#M26758</guid>
      <dc:creator>vyulun</dc:creator>
      <dc:date>2019-01-18T05:15:31Z</dc:date>
    </item>
    <item>
      <title>Re: Color the Table Cell based on inputlookup variable</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Color-the-Table-Cell-based-on-inputlookup-variable/m-p/407960#M26759</link>
      <description>&lt;P&gt;@vyulun&lt;/P&gt;

&lt;P&gt;Can you please share sample output of your search??  &lt;/P&gt;</description>
      <pubDate>Fri, 18 Jan 2019 05:28:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Color-the-Table-Cell-based-on-inputlookup-variable/m-p/407960#M26759</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2019-01-18T05:28:31Z</dc:date>
    </item>
    <item>
      <title>Re: Color the Table Cell based on inputlookup variable</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Color-the-Table-Cell-based-on-inputlookup-variable/m-p/407961#M26760</link>
      <description>&lt;P&gt;@vyulun&lt;/P&gt;

&lt;P&gt;Can you please check my answer on below link? I have used Javascript and CSS to achieve same requirement. Let me know for any further assistance.&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#answer-661940"&gt;https://answers.splunk.com/answers/661894/how-to-color-cell-contents-with-css-and-js.html#answer-661940&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 18 Jan 2019 06:47:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Color-the-Table-Cell-based-on-inputlookup-variable/m-p/407961#M26760</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2019-01-18T06:47:58Z</dc:date>
    </item>
    <item>
      <title>Re: Color the Table Cell based on inputlookup variable</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Color-the-Table-Cell-based-on-inputlookup-variable/m-p/407962#M26761</link>
      <description>&lt;P&gt;@vyulun&lt;/P&gt;

&lt;P&gt;I have tried with the same. Yes it is working if we defined hard coded value. But it is not when we mentioned &lt;STRONG&gt;field&lt;/STRONG&gt; name. I think we can only use value of that field which in mentioned in &lt;CODE&gt;colorPalette&lt;/CODE&gt; tag.&lt;/P&gt;

&lt;P&gt;I have posted  another answer to this question. I have achieved same thin using Javascript &amp;amp; CSS. Can you please check the same? &lt;/P&gt;</description>
      <pubDate>Fri, 18 Jan 2019 06:49:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Color-the-Table-Cell-based-on-inputlookup-variable/m-p/407962#M26761</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2019-01-18T06:49:13Z</dc:date>
    </item>
    <item>
      <title>Re: Color the Table Cell based on inputlookup variable</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Color-the-Table-Cell-based-on-inputlookup-variable/m-p/407963#M26762</link>
      <description>&lt;P&gt;&lt;A href="https://drive.google.com/file/d/16I7EPp22Zsrm33bga7T1deGt-qWomZ00/view?usp=sharing"&gt;https://drive.google.com/file/d/16I7EPp22Zsrm33bga7T1deGt-qWomZ00/view?usp=sharing&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Jan 2019 07:01:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Color-the-Table-Cell-based-on-inputlookup-variable/m-p/407963#M26762</guid>
      <dc:creator>vyulun</dc:creator>
      <dc:date>2019-01-18T07:01:13Z</dc:date>
    </item>
    <item>
      <title>Re: Color the Table Cell based on inputlookup variable</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Color-the-Table-Cell-based-on-inputlookup-variable/m-p/407964#M26763</link>
      <description>&lt;P&gt;thx, I will try css.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Jan 2019 07:57:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Color-the-Table-Cell-based-on-inputlookup-variable/m-p/407964#M26763</guid>
      <dc:creator>vyulun</dc:creator>
      <dc:date>2019-01-18T07:57:05Z</dc:date>
    </item>
  </channel>
</rss>

