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
Legend

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

---
What goes around comes around. If it helps, hit it with Karma 🙂
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
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Kick the Tires Before You Commit: A Hands-On Tour of the Splunk Observability Cloud ...

Evaluating an enterprise observability platform usually goes like this: fill out a form, get a free trial with ...

Deep insights, no barriers: Splunk Observability Cloud Free Edition

As software delivery cycles continue to accelerate, observability shouldn’t be a luxury — it should be a ...

Monitoring AI Agents with Splunk Observability Cloud

Let’s say I’m running a travel planning AI app in production. A user asks for three concise hotel options in ...