Many years ago, as a learning exercise, I created a web interface that took some boring static icons and made them spin around like a carousel. Check out a video here:
This interface was never meant to be particularly useful, but it worked and looked nice.
Fast forward to today. Thinking back on that carousel, I wondered if I could create something similar in Splunk. After all, SimpleXML renders to HTML and JavaScript in the end. My thought was, "what if we can make Single Value visualizations spin around? That could actually be useful in a NOC." So, I set out to find a JavaScript library that could do this (which I did find), and wired it up to the dashboard. It was shockingly easy to do. Here is the end result:
First, create a dashboard that has a row of Single Value visualizations. I borrowed some visualizations from the Dashboard Examples app. The important part of the dashboard XML is adding the JavaScript and adding an ID to the row as seen below:
<dashboard stylesheet="carousel.css" script="carousel.js">
<label>Single Value Carousel</label>
<row id="showcase">
The full text of the dashboard can be found here -> https://github.com/JasonConger/mte_visualizations/blob/master/app/mte_visualizations/default/data/ui/views/carousel2.xml
The next step is to create a JavaScript "shim" between the dashboard and the carousel code. Here is how it is done:
Excerpt from carousel.js:
require([
'underscore',
'jquery',
'splunkjs/mvc',
'splunkjs/mvc/simplexml/ready!',
'/static/app/mte_visualizations/js/lib/jquery.cloud9carousel.js'
], function(_, $, mvc, Carousel) {
var showcase = $("#showcase");
showcase.Cloud9Carousel( {
…options…
Notice the $("#showcase") part which finds the element with an ID of "showcase" – that finds the row of Single Value visualizations.
Next, we just let the Cloud9Carousel JavaScript library do its thing. There are several options you can set. Check out the source of carousel.js to see all the options I used. https://github.com/JasonConger/mte_visualizations/blob/master/app/mte_visualizations/appserver/static/carousel.js
Like I said, this was much easier than I thought and somewhat of a learning exercise. But, the technique used here to blend 3rd party JavaScript libraries with existing Splunk dashboards really isn’t that hard and
The Splunk platform removes the barriers between data and action, empowering observability, IT and security teams to ensure their organizations are secure, resilient and innovative.
Founded in 2003, Splunk is a global company — with over 7,500 employees, Splunkers have received over 1,020 patents to date and availability in 21 regions around the world — and offers an open, extensible data platform that supports shared data across any environment so that all teams in an organization can get end-to-end visibility, with context, for every interaction and business process. Build a strong data foundation with Splunk.