<?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 edit dashboard to use token values to determine table cell color ranges? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-edit-dashboard-to-use-token-values-to-determine-table/m-p/200879#M12618</link>
    <description>&lt;P&gt;I'm also looking for the solution to this problem.&lt;BR /&gt;
Is this not supported?&lt;/P&gt;</description>
    <pubDate>Wed, 05 Sep 2018 23:21:11 GMT</pubDate>
    <dc:creator>analyticator</dc:creator>
    <dc:date>2018-09-05T23:21:11Z</dc:date>
    <item>
      <title>How to edit dashboard to use token values to determine table cell color ranges?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-edit-dashboard-to-use-token-values-to-determine-table/m-p/200877#M12616</link>
      <description>&lt;P&gt;I've gotten a statistics table with cell column color formats changing depending on a value, such as:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    &amp;lt;format type="color" field="Tolerance"&amp;gt;
      &amp;lt;colorPalette type="list"&amp;gt;[#D93F3C,#FFFFFF,#FFFFFF]&amp;lt;/colorPalette&amp;gt;
      &amp;lt;scale type="threshold"&amp;gt;99,100&amp;lt;/scale&amp;gt;
    &amp;lt;/format&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;but I would like to provide the ability for the user to enter the cut-off value using an edit text field and token, such that the user can set the range tolerance, like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    &amp;lt;format type="color" field="Tolerance"&amp;gt;
      &amp;lt;colorPalette type="list"&amp;gt;[#D93F3C,#FFFFFF,#FFFFFF]&amp;lt;/colorPalette&amp;gt;
      &amp;lt;scale type="threshold"&amp;gt;$tolerance_range_break_value$,100&amp;lt;/scale&amp;gt;
    &amp;lt;/format&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;but the dashboard does not appear to accept tokens at this point in the source.  Is there a better way to achieve a variable range value for the format color?&lt;/P&gt;</description>
      <pubDate>Mon, 31 Oct 2016 19:51:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-edit-dashboard-to-use-token-values-to-determine-table/m-p/200877#M12616</guid>
      <dc:creator>kairisrj</dc:creator>
      <dc:date>2016-10-31T19:51:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit dashboard to use token values to determine table cell color ranges?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-edit-dashboard-to-use-token-values-to-determine-table/m-p/200878#M12617</link>
      <description>&lt;P&gt;Were you able to find a solution or  mechanism to do this? If so, please share&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2017 15:02:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-edit-dashboard-to-use-token-values-to-determine-table/m-p/200878#M12617</guid>
      <dc:creator>pramaswamy</dc:creator>
      <dc:date>2017-03-28T15:02:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit dashboard to use token values to determine table cell color ranges?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-edit-dashboard-to-use-token-values-to-determine-table/m-p/200879#M12618</link>
      <description>&lt;P&gt;I'm also looking for the solution to this problem.&lt;BR /&gt;
Is this not supported?&lt;/P&gt;</description>
      <pubDate>Wed, 05 Sep 2018 23:21:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-edit-dashboard-to-use-token-values-to-determine-table/m-p/200879#M12618</guid>
      <dc:creator>analyticator</dc:creator>
      <dc:date>2018-09-05T23:21:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit dashboard to use token values to determine table cell color ranges?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-edit-dashboard-to-use-token-values-to-determine-table/m-p/200880#M12619</link>
      <description>&lt;P&gt;If token needs to be supplied to the table only once on Form Load, the &lt;CODE&gt;expression&lt;/CODE&gt; &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Viz/TableFormatsXML#Color_palette_types_and_options"&gt;color palette for table formatting&lt;/A&gt; can be used to apply threshold by token. &lt;/P&gt;

&lt;P&gt;PS: token can be set only once i.e. through &lt;CODE&gt;&amp;lt;init&amp;gt;&lt;/CODE&gt; or &lt;CODE&gt;independent search event handler&lt;/CODE&gt;.  In the example I have used a text box but it is just to display the threshold set during dashboard load through &lt;CODE&gt;&amp;lt;init&amp;gt;&lt;/CODE&gt; section.&lt;/P&gt;

&lt;P&gt;This demo also showcases the &lt;CODE&gt;cascaded if expression&lt;/CODE&gt; used to evaluate multiple conditions as &lt;CODE&gt;case is not supported&lt;/CODE&gt; for expression color palette option. I have used three color just to test that all three conditions are being evaluated.&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/2088i680EB5B73D1003D5/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 Simple XML code for run anywhere example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
  &amp;lt;label&amp;gt;Splunk Answers 469742 - Table Tolerance as Token&amp;lt;/label&amp;gt;
  &amp;lt;init&amp;gt;
    &amp;lt;set token="tokToleranceThresholdGreen"&amp;gt;0&amp;lt;/set&amp;gt;
    &amp;lt;set token="tokToleranceThresholdYellow"&amp;gt;60&amp;lt;/set&amp;gt;
    &amp;lt;set token="tokToleranceThresholdRed"&amp;gt;80&amp;lt;/set&amp;gt;
    &amp;lt;set token="tokGreenHex"&amp;gt;#53A051&amp;lt;/set&amp;gt;
    &amp;lt;set token="tokYellowHex"&amp;gt;#F8BE34&amp;lt;/set&amp;gt;
    &amp;lt;set token="tokRedHex"&amp;gt;#DC4E41&amp;lt;/set&amp;gt;  
  &amp;lt;/init&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;| makeresults
| fields - _time
| eval Tolerance="30,121,78,23,90,99"
| makemv Tolerance delim=","
| mvexpand Tolerance&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;10&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;format type="color" field="Tolerance"&amp;gt;
          &amp;lt;colorPalette type="expression"&amp;gt;if(value &amp;gt;= $tokToleranceThresholdGreen$  AND value &amp;lt; $tokToleranceThresholdYellow$, "#53A051",if(value &amp;gt;= $tokToleranceThresholdYellow$ AND value &amp;lt; $tokToleranceThresholdRed$, "#F8BE34" ,"#DC4E41"))
          &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;row&amp;gt;
    &amp;lt;panel id="panelLegend"&amp;gt;
      &amp;lt;title&amp;gt;Tolerance Threshold Legend&amp;lt;/title&amp;gt;
      &amp;lt;html&amp;gt;
        &amp;lt;style&amp;gt;
          #panelLegend{
            width: 30% !important;
            float:right;
          }
        &amp;lt;/style&amp;gt;
        &amp;lt;div&amp;gt;
          &amp;lt;div style="background-color:$tokGreenHex$"&amp;gt;Green: Threshold: $tokToleranceThresholdGreen$ - $tokToleranceThresholdYellow$&amp;lt;/div&amp;gt;
          &amp;lt;div style="background-color:$tokYellowHex$"&amp;gt;Yellow: Threshold: $tokToleranceThresholdYellow$ - $tokToleranceThresholdRed$&amp;lt;/div&amp;gt;
          &amp;lt;div style="background-color:$tokRedHex$"&amp;gt;Red: Threshold: &amp;gt; $tokToleranceThresholdRed$&amp;lt;/div&amp;gt;
        &amp;lt;/div&amp;gt;
      &amp;lt;/html&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>Thu, 06 Sep 2018 04:20:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-edit-dashboard-to-use-token-values-to-determine-table/m-p/200880#M12619</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-09-06T04:20:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit dashboard to use token values to determine table cell color ranges?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-edit-dashboard-to-use-token-values-to-determine-table/m-p/200881#M12620</link>
      <description>&lt;P&gt;PS: Splunk Answers replaces xml escape characters while posting answers/comment so make sure you use &lt;CODE&gt;&amp;amp; lt ;&lt;/CODE&gt; and &lt;CODE&gt;&amp;amp; gt ;&lt;/CODE&gt; (without spaces to escape these characters).&lt;/P&gt;

&lt;P&gt;&lt;A href="https://www.advancedinstaller.com/user-guide/xml-escaped-chars.html"&gt;https://www.advancedinstaller.com/user-guide/xml-escaped-chars.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Sep 2018 04:22:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-edit-dashboard-to-use-token-values-to-determine-table/m-p/200881#M12620</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-09-06T04:22:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit dashboard to use token values to determine table cell color ranges?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-edit-dashboard-to-use-token-values-to-determine-table/m-p/200882#M12621</link>
      <description>&lt;P&gt;Thanks for the reply. &lt;BR /&gt;
I tried this and it doesn't seem to work for Splunk version 7.0.2.&lt;BR /&gt;
Maybe it will work with higher version.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Sep 2018 17:18:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-edit-dashboard-to-use-token-values-to-determine-table/m-p/200882#M12621</guid>
      <dc:creator>analyticator</dc:creator>
      <dc:date>2018-09-06T17:18:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit dashboard to use token values to determine table cell color ranges?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-edit-dashboard-to-use-token-values-to-determine-table/m-p/200883#M12622</link>
      <description>&lt;P&gt;@analyticator this feature should be available from 6.5 and above. So it should work on 7.0.2 as well: &lt;A href="http://docs.splunk.com/Documentation/Splunk/7.0.2/Viz/TableFormatsXML#Color_palette_types_and_options"&gt;http://docs.splunk.com/Documentation/Splunk/7.0.2/Viz/TableFormatsXML#Color_palette_types_and_options&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;If the same is not working, I would expect some other issue.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Oct 2018 11:01:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-edit-dashboard-to-use-token-values-to-determine-table/m-p/200883#M12622</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-10-18T11:01:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit dashboard to use token values to determine table cell color ranges?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-edit-dashboard-to-use-token-values-to-determine-table/m-p/534889#M36472</link>
      <description>&lt;P&gt;Sorry to bump old post.&lt;/P&gt;&lt;P&gt;Solution suggested by&amp;nbsp;@niketnlay has solved it. Splunk Enterprise&amp;nbsp;&lt;SPAN&gt;8.0.5.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;This is the key concept:&lt;BR /&gt;&amp;lt;table&amp;gt;&amp;lt;format&amp;gt;&amp;lt;colorPalette type="&lt;STRONG&gt;expression&lt;/STRONG&gt;"&amp;gt;&lt;/P&gt;&lt;P&gt;I had no luck with simply putting a token into the code the UI is generating for us:&amp;nbsp;&lt;BR /&gt;&amp;lt;colorPalette type="&lt;STRONG&gt;list&lt;/STRONG&gt;"&amp;gt;&amp;lt;scale type="&lt;STRONG&gt;threshold&lt;/STRONG&gt;"&amp;gt;&lt;/P&gt;&lt;P&gt;Below example works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;table&amp;gt;
...
  &amp;lt;format type="color" field="age_in_mins"&amp;gt;
    &amp;lt;colorPalette type="expression"&amp;gt;if(value &amp;gt;= 
$threshold_in_mins_tok$,"#DC4E41", "#53A051")&amp;lt;/colorPalette&amp;gt;
    &amp;lt;!--colorPalette type="list"&amp;gt;[#53A051,#DC4E41]&amp;lt;/colorPalette&amp;gt;
    &amp;lt;scale type="threshold"&amp;gt;$threshold_in_mins_tok2$&amp;lt;/scale--&amp;gt;
  &amp;lt;/format&amp;gt;
&amp;lt;/table&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jan 2021 05:45:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-edit-dashboard-to-use-token-values-to-determine-table/m-p/534889#M36472</guid>
      <dc:creator>shandr</dc:creator>
      <dc:date>2021-01-06T05:45:26Z</dc:date>
    </item>
  </channel>
</rss>

