Dashboards & Visualizations

colouring Header of the table in splunk

abhayneilam
Contributor

Hi,

I have a dashboard which is having two tables, one table is showing the critical data and other data is showing the normal data.
My requirement is Normal data table should have YELLOW colour as a header ( means the whole box where the dashboard panel title is written ) and the critical data table should have RED colour as a header ( means the whole box where the dashboard panel title is written ) .

Please help !!

0 Karma

stephanefotso
Motivator

you can use the html for the header of the table and then use the CSS to color the back ground. I'will use two files: table_header_highlighting.xml and table_header_highlighting.css.put the css file in the static folder of your application: your_app_name/appserver/static

table_header_highlighting.xml

<dashboard stylesheet="table_header_highlighting.css">
           <label>colouring_header_of_the_table</label>
           <description/>
           <row grouping="2,2">

             <html>
              <h1 id="id1">
                  Top Sourcetypes (Last 24 hours)
              </h1>

             </html>

             <table>

                    <searchString>index=_internal | top limit=100 sourcetype | eval percent = round(percent,2)</searchString>
                    <earliestTime>-24h@h</earliestTime>
                    <latestTime>now</latestTime>
                    <option name="wrap">true</option>
                    <option name="rowNumbers">true</option>
                    <option name="dataOverlayMode">none</option>
                    <option name="drilldown">cell</option>
                    <option name="count">10</option>
           </table>

              <html>
              <h1 id="id2">
                  Rare Sourcetypes (Last 24 hours)
              </h1>

            </html>
             <table>

                    <searchString>index=_internal | rare limit=100 sourcetype | eval percent = round(percent,2)</searchString>
                    <earliestTime>-24h@h</earliestTime>
                    <latestTime>now</latestTime>
                    <option name="wrap">true</option>
                    <option name="rowNumbers">true</option>
                    <option name="dataOverlayMode">none</option>
                    <option name="drilldown">cell</option>
                    <option name="count">10</option>
             </table>

           </row>
</dashboard>

table_header_highlighting.css

#id1 {
    background-color: yellow;
}

#id2 {
    background-color: red;
}

,

SGF
0 Karma
Get Updates on the Splunk Community!

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...

New! Splunk Observability Search Enhancements for Splunk APM Services/Traces and ...

Regardless of where you are in Splunk Observability, you can search for relevant APM targets including service ...

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...