<?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 refer to a column value ? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-refer-to-a-column-value/m-p/514096#M34324</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/65483"&gt;@zacksoft&lt;/a&gt;&amp;nbsp;you can refer to the following answer with two approach Simple XML and JS&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-highlight-a-table-cell-based-on-a-field-of-the-search/td-p/455645" target="_blank"&gt;https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-highlight-a-table-cell-based-on-a-field-of-the-search/td-p/455645&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Simple XML approach in the above answer shows the field to decide color as part of value field as well. However, you can adapt the following answer so that it applies color based on other cell without showing the dependent value using Simple XML without JS:&amp;nbsp;&lt;A href="https://community.splunk.com/t5/Dashboards-Visualizations/How-to-change-font-color-based-on-a-condition-for-a-particular/td-p/487257" target="_blank"&gt;https://community.splunk.com/t5/Dashboards-Visualizations/How-to-change-font-color-based-on-a-condition-for-a-particular/td-p/487257&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 14 Aug 2020 13:10:29 GMT</pubDate>
    <dc:creator>niketn</dc:creator>
    <dc:date>2020-08-14T13:10:29Z</dc:date>
    <item>
      <title>How to refer to a column value ?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-refer-to-a-column-value/m-p/514084#M34321</link>
      <description>&lt;P&gt;My query generates a table with two columns .&lt;BR /&gt;| index = somethnig&lt;BR /&gt;| table car price&lt;BR /&gt;&lt;BR /&gt;car&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;price&lt;BR /&gt;yegalo&amp;nbsp; &amp;nbsp; &amp;nbsp;2999&lt;BR /&gt;printek&amp;nbsp; &amp;nbsp; 3444&lt;BR /&gt;altox&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;5433&lt;BR /&gt;ylome&amp;nbsp; &amp;nbsp; 3222&lt;BR /&gt;&lt;BR /&gt;etc..&lt;BR /&gt;&lt;BR /&gt;I want to color the column price as red or green depending on the car name.&lt;BR /&gt;If the car name is yegalo or ylome then the respective rows i.e. 2999 or 3222 should be red , others should be green.&lt;BR /&gt;&lt;BR /&gt;I am trying the following in the simpleXML&lt;/P&gt;&lt;PRE&gt;&amp;lt;format type="color" field="price"&amp;gt;
          &amp;lt;colorPalette type="expression"&amp;gt;&lt;U&gt;if(like(value,"%y")&lt;/U&gt;, "#00F000", "#F00000")&amp;lt;/colorPalette&amp;gt;
        &amp;lt;/format&amp;gt;&lt;/PRE&gt;&lt;P&gt;How ever the underlined if condition is checking the condition in "price" column instead of "car" column.&amp;nbsp;&lt;BR /&gt;I tried&amp;nbsp; &amp;nbsp; if(like($result.car,"%y"),&amp;nbsp; &amp;nbsp; But it won't work.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Aug 2020 12:23:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-refer-to-a-column-value/m-p/514084#M34321</guid>
      <dc:creator>zacksoft</dc:creator>
      <dc:date>2020-08-14T12:23:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to refer to a column value ?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-refer-to-a-column-value/m-p/514096#M34324</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/65483"&gt;@zacksoft&lt;/a&gt;&amp;nbsp;you can refer to the following answer with two approach Simple XML and JS&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-highlight-a-table-cell-based-on-a-field-of-the-search/td-p/455645" target="_blank"&gt;https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-highlight-a-table-cell-based-on-a-field-of-the-search/td-p/455645&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Simple XML approach in the above answer shows the field to decide color as part of value field as well. However, you can adapt the following answer so that it applies color based on other cell without showing the dependent value using Simple XML without JS:&amp;nbsp;&lt;A href="https://community.splunk.com/t5/Dashboards-Visualizations/How-to-change-font-color-based-on-a-condition-for-a-particular/td-p/487257" target="_blank"&gt;https://community.splunk.com/t5/Dashboards-Visualizations/How-to-change-font-color-based-on-a-condition-for-a-particular/td-p/487257&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Aug 2020 13:10:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-refer-to-a-column-value/m-p/514096#M34324</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2020-08-14T13:10:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to refer to a column value ?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-refer-to-a-column-value/m-p/514099#M34326</link>
      <description>&lt;P&gt;Try changing&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;field="price"&lt;/PRE&gt;&lt;P&gt;to&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;field="car"&lt;/PRE&gt;</description>
      <pubDate>Fri, 14 Aug 2020 13:21:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-refer-to-a-column-value/m-p/514099#M34326</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-08-14T13:21:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to refer to a column value ?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-refer-to-a-column-value/m-p/514100#M34327</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/201110"&gt;@niketn&lt;/a&gt;&amp;nbsp;.&lt;BR /&gt;I have to use the simpleXML way, However I am a bit confused with the solution and I could use some help in understanding.&lt;BR /&gt;The solution is becoming something like this&lt;/P&gt;&lt;PRE&gt;&amp;lt;format type="color" field="price"&amp;gt;
          &amp;lt;colorPalette type="map"&amp;gt;{"2999":#D93F3C,"4999":#6DB7C6}&amp;lt;/colorPalette&amp;gt;
        &amp;lt;/format&amp;gt;&lt;/PRE&gt;&lt;P&gt;then again it is looking at the "price" field for determining the colour of "price" cell. It ain't checking the field "car" . Based on field "car" it is supposed to change the "price" colour.&lt;BR /&gt;&lt;BR /&gt;Sorry If I misunderstood the simpleXML solution.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Aug 2020 13:28:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-refer-to-a-column-value/m-p/514100#M34327</guid>
      <dc:creator>zacksoft</dc:creator>
      <dc:date>2020-08-14T13:28:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to refer to a column value ?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-refer-to-a-column-value/m-p/514101#M34328</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt;&amp;nbsp; If I change field="price" to field="car" , then it is changing the colour of the "car" field , not the "price" field. What I am looking is to change the colour of "price" depending on the values present in "car".&lt;/P&gt;</description>
      <pubDate>Fri, 14 Aug 2020 13:32:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-refer-to-a-column-value/m-p/514101#M34328</guid>
      <dc:creator>zacksoft</dc:creator>
      <dc:date>2020-08-14T13:32:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to refer to a column value ?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-refer-to-a-column-value/m-p/514108#M34331</link>
      <description>&lt;P&gt;The complete Simple XML approach in the second answer link (&lt;A href="https://community.splunk.com/t5/Dashboards-Visualizations/How-to-change-font-color-based-on-a-condition-for-a-particular/td-p/487257" target="_blank"&gt;https://community.splunk.com/t5/Dashboards-Visualizations/How-to-change-font-color-based-on-a-condition-for-a-particular/td-p/487257&lt;/A&gt;) is to :&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Use an eval and suffix label value along with a delimiter to all other fields in the same row.&lt;/LI&gt;&lt;LI&gt;Then use split() eval function to split the values into multivalue field.&lt;/LI&gt;&lt;LI&gt;Then use Simple XML CSS to hide the split value from the label field.&lt;/LI&gt;&lt;LI&gt;Finally apply expression based on label field value that is present in the second field but hidden through CSS. You can try to run the example code and open the search in a new window to see how SPL for above steps are working.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;If not you will have to use JS but approach for data will remain the same in SPL. PS the row in the example is colored based on label field log_level.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Aug 2020 13:51:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-refer-to-a-column-value/m-p/514108#M34331</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2020-08-14T13:51:01Z</dc:date>
    </item>
  </channel>
</rss>

