<?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: Modifying CSS to colorize Table Rows in Dashboard Panel with Event-Renderer.conf? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Modifying-CSS-to-colorize-Table-Rows-in-Dashboard-Panel-with/m-p/60887#M3195</link>
    <description>&lt;P&gt;See here for another approach:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://splunk-base.splunk.com/answers/13012/does-42-have-any-capabilities-to-set-a-row-color-based-on-a-field-example?page=1#22445"&gt;http://splunk-base.splunk.com/answers/13012/does-42-have-any-capabilities-to-set-a-row-color-based-on-a-field-example?page=1#22445&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 15 Apr 2011 15:45:26 GMT</pubDate>
    <dc:creator>araitz</dc:creator>
    <dc:date>2011-04-15T15:45:26Z</dc:date>
    <item>
      <title>Modifying CSS to colorize Table Rows in Dashboard Panel with Event-Renderer.conf?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Modifying-CSS-to-colorize-Table-Rows-in-Dashboard-Panel-with/m-p/60879#M3187</link>
      <description>&lt;P&gt;What Custom CSS config would I need in order to colorize the rows of a real-time dashboard table based on one of the values in that table?  &lt;/P&gt;

&lt;P&gt;As to IT Bullgod's answer, here is my modified app configuration.&lt;/P&gt;

&lt;P&gt;eventtypes.conf in apps/app_name/default&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[FreeSpace_Green]
search = name=mon-storage capacity&amp;gt;0 AND capacity&amp;lt;60
[FreeSpace_Yellow]
search = name=mon-storage capacity&amp;gt;59 AND capacity&amp;lt;85
[FreeSpace_Red]
search = name=mon-storage capacity&amp;gt;84
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;event_renderers.conf in apps/app_name/default&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[FreeSpaceGreen]
eventtype = "FreeSpace_Green"
css_class = FreeSpaceGreen

[FreeSpaceYellow]
eventtype = "FreeSpace_Yellow"
css_class = FreeSpaceYellow

[FreeSpaceRed]
eventtype = "FreeSpace_Red"
css_class = FreeSpaceRed
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;application.css in apps/app_name/appserver/static&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;.EventsViewer .splEvent-FreeSpaceGreen .event  {
    color: green;
}

.EventsViewer .splEvent-FreeSpaceYellow .event {
    color: yellow;
}

.EventsViewer .splEvent-FreeSpaceRed .event  {
    color: red;
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;dashboard_panel.xml in apps/app_name/default/data/ui/views&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;module name="HiddenSearch" layoutPanel="panel_row3_col1" group="TEST" autoRun="True"&amp;gt;
&amp;lt;param name="search"&amp;gt;eventtype="FreeSpace_Green"&amp;lt;/param&amp;gt;
&amp;lt;param name="latest"&amp;gt;now&amp;lt;/param&amp;gt;
&amp;lt;param name="earliest"&amp;gt;-15m&amp;lt;/param&amp;gt;
&amp;lt;module name="EnablePreview"&amp;gt;
   &amp;lt;param name="enable"&amp;gt;true&amp;lt;/param&amp;gt;
   &amp;lt;param name="display"&amp;gt;false&amp;lt;/param&amp;gt;
&amp;lt;module name="SimpleResultsTable"&amp;gt;
&amp;lt;/module&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;
 &lt;/P&gt;

&lt;P&gt;When I view the dashboard, I see the table with the events, but they are not colorized.  What am I doing wrong?&lt;/P&gt;</description>
      <pubDate>Thu, 30 Sep 2010 02:26:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Modifying-CSS-to-colorize-Table-Rows-in-Dashboard-Panel-with/m-p/60879#M3187</guid>
      <dc:creator>muebel</dc:creator>
      <dc:date>2010-09-30T02:26:13Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying CSS to colorize Table Rows in Dashboard Panel with Event-Renderer.conf?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Modifying-CSS-to-colorize-Table-Rows-in-Dashboard-Panel-with/m-p/60880#M3188</link>
      <description>&lt;P&gt;Assuming the dashboard is using &lt;CODE&gt;SimpleResultsTable&lt;/CODE&gt;, this doesn't appear to be possible via CSS alone.&lt;/P&gt;

&lt;P&gt;Custom Event Renderers will add a CSS class when using an &lt;CODE&gt;EventsViewer&lt;/CODE&gt; module, but not when using &lt;CODE&gt;SimpleResultsTable&lt;/CODE&gt; -- they render individual events, not results.&lt;/P&gt;

&lt;P&gt;I have an open question along these lines as well:&lt;BR /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;A href="http://answers.splunk.com/questions/6698/heatmap-style-overlay-at-row-level" rel="nofollow"&gt;http://answers.splunk.com/questions/6698/heatmap-style-overlay-at-row-level&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;You would need to be able to add a CSS class the &lt;CODE&gt;&amp;lt;tr&amp;gt;&lt;/CODE&gt; tag and/or each &lt;CODE&gt;&amp;lt;td&amp;gt;&lt;/CODE&gt; tag in the row. The difficulty is in adding a new CSS class based on your "trigger" value in that row. Once you have the class tag, the CSS is easy via &lt;CODE&gt;application.css&lt;/CODE&gt; or by assigning a stylesheet in the view definition.&lt;/P&gt;

&lt;P&gt;The two approaches I know of are:&lt;/P&gt;

&lt;P&gt;&lt;LI&gt;Use JavaScript to check each row and add a given CSS class to each cell in the row, based on the value of the cell you're using to trigger colorization.&lt;/LI&gt;&lt;/P&gt;

&lt;P&gt;&lt;LI&gt;Customize or replace the &lt;CODE&gt;SimpleResultsTable&lt;/CODE&gt; module to add the needed CSS classes.&lt;/LI&gt;&lt;/P&gt;

&lt;P&gt;Neither is particularly elegant. Unless someone offers a better way, this would be a great enhancement request. I've had some (very limited) success experimenting with the second option.&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;If you are using &lt;CODE&gt;EventViewer&lt;/CODE&gt; to view individual events, then Event Renderers may be an option.&lt;/P&gt;

&lt;P&gt;The default CSS approach shown &lt;A href="http://www.splunk.com/base/Documentation/4.1.5/Developer/EventRendering" rel="nofollow"&gt;here&lt;/A&gt; never worked for me as shown, possibly because I haven't tried it with custom HTML, or possibly because of the particular CSS elements I was trying to use. &lt;/P&gt;

&lt;P&gt;If you don't see anything happening, consider using &lt;A href="http://getfirebug.com/" rel="nofollow"&gt;Firebug&lt;/A&gt; to verify that the CSS class is really being added, and to see what the CSS heirarchy should look like. You may need to adjust CSS paths, for example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;.splEvent-FreeSpaceGreen table tbody tr td .event em {
        color: #00ff00;
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can use the &lt;A href="https://addons.mozilla.org/en-US/firefox/addon/46211/" rel="nofollow"&gt;CSS Reloader&lt;/A&gt; plugin to make it easier to preview CSS changes as you make them.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Sep 2010 04:56:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Modifying-CSS-to-colorize-Table-Rows-in-Dashboard-Panel-with/m-p/60880#M3188</guid>
      <dc:creator>southeringtonp</dc:creator>
      <dc:date>2010-09-30T04:56:20Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying CSS to colorize Table Rows in Dashboard Panel with Event-Renderer.conf?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Modifying-CSS-to-colorize-Table-Rows-in-Dashboard-Panel-with/m-p/60881#M3189</link>
      <description>&lt;P&gt;There are 3 things you'll need to modify to "colorize" results from a search:&lt;/P&gt;

&lt;P&gt;1- Configure eventtypes that are unique based on the field values used in your results &lt;/P&gt;

&lt;P&gt;2- Configure event renderers that will point to the proper CSS class for each color (based on each unique eventtype)&lt;/P&gt;

&lt;P&gt;3 - Add stanzas to the CSS which include the actual colorings&lt;/P&gt;

&lt;P&gt;Here's the mechanics and an example for each of these:&lt;/P&gt;

&lt;P&gt;1- Modify eventtypes.conf to include a unique eventtype for each value of the field you're evaluating.&lt;/P&gt;

&lt;P&gt;------------eventtypes.conf-------------&lt;/P&gt;

&lt;P&gt;[normal]&lt;BR /&gt;
search = sourcetype="your_sourcetype" your_field="Normal"&lt;/P&gt;

&lt;P&gt;[warning]&lt;BR /&gt;
search = sourcetype="your_sourcetype" your_field="Warning"&lt;/P&gt;

&lt;P&gt;[critical]&lt;BR /&gt;
search = sourcetype="your_sourcetype" your_field="Critical"&lt;/P&gt;

&lt;P&gt;2- Next configure event_renderers.conf to look like this:&lt;/P&gt;

&lt;P&gt;------------event_renderers.conf-------------&lt;/P&gt;

&lt;P&gt;[EventRendererNormal]&lt;BR /&gt;
eventtype = normal&lt;BR /&gt;
css_class = EventRendererNormal&lt;BR /&gt;&lt;/P&gt;

&lt;P&gt;[EventRendererWarning]&lt;BR /&gt;
eventtype = warning&lt;BR /&gt;
css_class = EventRendererWarning&lt;BR /&gt;&lt;/P&gt;

&lt;P&gt;[EventRendererCritical]&lt;BR /&gt;
eventtype = critical&lt;BR /&gt;
css_class = EventRendererCritical&lt;BR /&gt;&lt;/P&gt;

&lt;P&gt;3- Finally, modify the CSS classes to map actual colors to the event renderers: &lt;/P&gt;

&lt;P&gt;------------application.css-------------&lt;BR /&gt;
.EventsViewer .splEvent-EventRendererNormal .event  {&lt;BR /&gt;
    color: green;&lt;BR /&gt;
}&lt;/P&gt;

&lt;P&gt;.EventsViewer .splEvent-EventRendererWarning .event {&lt;BR /&gt;
    color: yellow;&lt;BR /&gt;
}&lt;/P&gt;

&lt;P&gt;.EventsViewer .splEvent-EventRendererCritical .event  {&lt;BR /&gt;
    color: red;&lt;BR /&gt;
}&lt;/P&gt;</description>
      <pubDate>Sun, 03 Oct 2010 03:44:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Modifying-CSS-to-colorize-Table-Rows-in-Dashboard-Panel-with/m-p/60881#M3189</guid>
      <dc:creator>IT_Bullgod</dc:creator>
      <dc:date>2010-10-03T03:44:37Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying CSS to colorize Table Rows in Dashboard Panel with Event-Renderer.conf?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Modifying-CSS-to-colorize-Table-Rows-in-Dashboard-Panel-with/m-p/60882#M3190</link>
      <description>&lt;P&gt;can't seem to get it to work as suggested.  I included the current config I am using in the question.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Oct 2010 21:53:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Modifying-CSS-to-colorize-Table-Rows-in-Dashboard-Panel-with/m-p/60882#M3190</guid>
      <dc:creator>muebel</dc:creator>
      <dc:date>2010-10-05T21:53:11Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying CSS to colorize Table Rows in Dashboard Panel with Event-Renderer.conf?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Modifying-CSS-to-colorize-Table-Rows-in-Dashboard-Panel-with/m-p/60883#M3191</link>
      <description>&lt;P&gt;You're trying to use an event renderer with SimpleResultsTable, which displays results, not events.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Oct 2010 06:47:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Modifying-CSS-to-colorize-Table-Rows-in-Dashboard-Panel-with/m-p/60883#M3191</guid>
      <dc:creator>southeringtonp</dc:creator>
      <dc:date>2010-10-07T06:47:19Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying CSS to colorize Table Rows in Dashboard Panel with Event-Renderer.conf?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Modifying-CSS-to-colorize-Table-Rows-in-Dashboard-Panel-with/m-p/60884#M3192</link>
      <description>&lt;P&gt;Thanks for update.  I changed SimpleResultsTable to EventsViewer and left all other config unchanged.  That isn't showing the rows to be colorized.  Is there something else I could be missing?&lt;/P&gt;</description>
      <pubDate>Thu, 07 Oct 2010 21:35:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Modifying-CSS-to-colorize-Table-Rows-in-Dashboard-Panel-with/m-p/60884#M3192</guid>
      <dc:creator>muebel</dc:creator>
      <dc:date>2010-10-07T21:35:39Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying CSS to colorize Table Rows in Dashboard Panel with Event-Renderer.conf?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Modifying-CSS-to-colorize-Table-Rows-in-Dashboard-Panel-with/m-p/60885#M3193</link>
      <description>&lt;P&gt;My guess is that the CSS is being added, but your stylesheet isn't quite right. See edits above.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Oct 2010 23:37:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Modifying-CSS-to-colorize-Table-Rows-in-Dashboard-Panel-with/m-p/60885#M3193</guid>
      <dc:creator>southeringtonp</dc:creator>
      <dc:date>2010-10-07T23:37:39Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying CSS to colorize Table Rows in Dashboard Panel with Event-Renderer.conf?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Modifying-CSS-to-colorize-Table-Rows-in-Dashboard-Panel-with/m-p/60886#M3194</link>
      <description>&lt;P&gt;I plan on looking at this again in the near future.  For the record, I haven't been able to get a workable solution, but intend to.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Oct 2010 01:13:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Modifying-CSS-to-colorize-Table-Rows-in-Dashboard-Panel-with/m-p/60886#M3194</guid>
      <dc:creator>muebel</dc:creator>
      <dc:date>2010-10-22T01:13:18Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying CSS to colorize Table Rows in Dashboard Panel with Event-Renderer.conf?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Modifying-CSS-to-colorize-Table-Rows-in-Dashboard-Panel-with/m-p/60887#M3195</link>
      <description>&lt;P&gt;See here for another approach:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://splunk-base.splunk.com/answers/13012/does-42-have-any-capabilities-to-set-a-row-color-based-on-a-field-example?page=1#22445"&gt;http://splunk-base.splunk.com/answers/13012/does-42-have-any-capabilities-to-set-a-row-color-based-on-a-field-example?page=1#22445&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Apr 2011 15:45:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Modifying-CSS-to-colorize-Table-Rows-in-Dashboard-Panel-with/m-p/60887#M3195</guid>
      <dc:creator>araitz</dc:creator>
      <dc:date>2011-04-15T15:45:26Z</dc:date>
    </item>
  </channel>
</rss>

