Dashboards & Visualizations

css file in xml file

jip31
Motivator

hi

i have done a css file but i dont know to to put it in the xml file
which tags are mandatory?

i'm looking for a xml example file with css Inside
thanks

Tags (1)
0 Karma
1 Solution

harishalipaka
Motivator

hi @jip
Here below app have many examples .. https://splunkbase.splunk.com/app/1603/

Thanks
Harish

View solution in original post

0 Karma

harishalipaka
Motivator

hi @jip
Here below app have many examples .. https://splunkbase.splunk.com/app/1603/

Thanks
Harish
0 Karma

manish_singh_77
Builder

Hi jip31,

You can refer the below sample and let me know if you have got any more queries..

<dashboard>
   <label>Test</label>
      <row>
     <panel>
    <html>
      <style>
      #sla_table {
     font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
     border-collapse: collapse;
     width: 100%;
 }

 #sla_table td, #sla_table th {
     border: 1px solid #ddd;
     padding: 2px;
 }

 #sla_table th {
     padding-top: 2px;
     padding-bottom: 2px;
     text-align: left;
     background-color: #C0C0C0;
     color: black;
 }

 </style>
     <table id = "sla_table">
   <tr>
     <th>Duration</th>
     <th>Start Time</th> 
     <th>Result Rows</th>
      </tr>
   <tr>
     <td>$duration$</td>
     <td>$starttime$</td>
     <td>$resultcount$</td>
       </tr>
   </table>
   </html>
   </panel>
   </row>
 </dashboard>
0 Karma

renjith_nair
SplunkTrust
SplunkTrust

Hi @jip31 ,

You can use <dashboard stylesheet="<style_filename>.css" script="<script_filename>.js"> in your XML

Reference : https://docs.splunk.com/Documentation/Splunk/7.1.1/AdvancedDev/UseCSS

Happy Splunking!
0 Karma

jip31
Motivator

many thanks!

0 Karma

niketn
Legend

@jip31 kindly unaccept your comment and accept the answer below which has resolved your issue.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

Anam
Community Manager
Community Manager

@jip31

My name is Anam and I am the Community Content Specialist for Splunk Answers. As @niketnilay mentioned earlier to you, refrain from accepting your own answers and please accept the answer that has worked for you in this question. You also accepted another one of your own answers in this question as well: https://answers.splunk.com/answers/669860/plus-and-minus-in-a-trend-calcul.html which was fixed. We have awesome contributors in this community and their effort should be appreciated and encouraged!

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...