Archive
Highlighted

css file in xml file

Contributor

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
Highlighted

Re: css file in xml file

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

0 Karma
Highlighted

Re: css file in xml file

Contributor

many thanks!

0 Karma
Highlighted

Re: css file in xml file

Legend

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




| eval message="Happy Splunking!!!"


0 Karma
Highlighted

Re: css file in xml file

Moderator
Moderator

@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
Highlighted

Re: css file in xml file

Contributor

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
Highlighted

Re: css file in xml file

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

View solution in original post

0 Karma