Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Splunk Developer's Guide, Second Edition

You're reading from   Splunk Developer's Guide, Second Edition Learn the A to Z of building excellent Splunk applications with the latest techniques using this comprehensive guide

Arrow left icon
Product type Paperback
Published in Jan 2016
Publisher
ISBN-13 9781785882371
Length 190 pages
Edition 2nd Edition
Tools
Arrow right icon
Authors (2):
Arrow left icon
Kyle Smith Kyle Smith
Author Profile Icon Kyle Smith
Kyle Smith
Marco Scala Marco Scala
Author Profile Icon Marco Scala
Marco Scala
Arrow right icon
View More author details
Toc

Custom JavaScript, CSS, and Tokens

There will be times when you will want to integrate custom visualizations, custom CSS, or helper JavaScript into a SimpleXML dashboard. Thankfully, we have been provided a way to do so. At the very top of the dashboard/form source code, you will either see the <dashboard> or <form> tag. Within those tags, as attributes, is where you will declare what scripts should be included in your dashboard:

<dashboard script="my_script.js" stylesheet="my_style.css">

This allows the loading of custom scripts and CSS from the $APP_HOME/appserver/static folder. Placing these files into that folder gives the dashboard access to them. From here, you can interact with the dashboard using jQuery, or another framework, and make it bend to your will.

Another feature of SimpleXML is the ability to manipulate tokens. Let's take, for example, the text input. Let's define it like this in the source code:

<input type="text&quot...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image