Developing Dashboards, Views, and Apps for Splunk Web

 


Step 1: create a dashboard

This documentation does not apply to the most recent version of Splunk. Click here for the latest version.

Step 1: create a dashboard

The first step when working with dashboards is to create your dashboard template. Splunk gives you two different options when creating a dashboard: use the visual dashboard builder, or use Splunk's view XML. If you've never created a dashboard in Splunk before, we recommend starting with the visual dashboard builder. The visual dashboard builder writes out your dashboard configuration in the simplified XML, so you can always go in and edit that by hand if you find the visual dashboard editor doesn't provide you with all the configurations you need.

To read more about the visual dashboard editor, see "Create simple dashboards with the visual dashboard editor" in the User Manual.

Use Splunk's XML syntax

If you're ready to try out the XML syntax to build your dashboard, follow these instructions. Create your dashboard's XML file either through Splunk Manager or through the underlying file system.

in Splunk Manager

1. From Splunk Web, navigate to Manager.

2. Click User Interface.

3. Click Add new next to views to create a new dashboard.

4. Follow the instructions on the new view page and enter XML in the format described below.

For example, if you want to add a new view to the Search App, navigate to the Search App in Splunk Web and then click the Manager link in the upper right-hand corner, then click Views. You'll see a list of existing views, which you can clone if you want to copy and make changes to an existing view. To create an entirely new view, click New.

in Splunk's file system

1. Create your view XML file directly in your app via the file system.

2. Make sure your dashboard's XML file goes in $SPLUNK_HOME/etc/apps/<app_name>/default/data/ui/views/.

XML configuration

Once you've created a file for your dashboard, add XML to structure the dashboard. Start by creating a dashboard element and setting a label attribute. The label shows up in the drop-down menu in Splunk Web. Dashboard names can contain spaces, alphanumeric characters, underscores or dashes.

This example creates an empty dashboard page, which has the standard Splunk header, navigation and a label of "My dashboard":

<dashboard>
    <label>My dashboard</label>
</dashboard>

Optionally set the refresh rate for the entire dashboard by adding a refresh="<seconds>" attribute:

<dashboard refresh="30">
    <label>My dashboard</label>
</dashboard>

Now you're ready to add content to your dashboard by creating rows and panels. Move on to step 2 to learn about adding rows.

Important notes about XML

There are a few things you should note about XML, especially if you've never worked with it before. Please read through this section -- it will make your whole view building experience more pleasant.

XML escaped characters

There are five characters that are not supported in XML. These are ", ', <, > and &. You must escape them much like URL encoding:

Character XML escaped version
"
&quot;
'
&apos;
<
&lt;
>
&gt;
&
&amp;

Schemas and editors

Many XML editors will let you load a schema -- DTD, XSD, Relax, RelaxNG are just a few different types of schemas. Schemas are useful for validating your XML and also for providing you with guidelines while building an XML file. Splunk contains RelaxNG formatted schemas for views, from dashboards to form searches to advanced XML views. Read more about how to use Splunk's schemas in the Use schemas topic in this manual.

This documentation applies to the following versions of Splunk: 4.1 , 4.1.1 , 4.1.2 , 4.1.3 , 4.1.4 , 4.1.5 , 4.1.6 , 4.1.7 , 4.1.8 View the Article History for its revisions.


You must be logged into splunk.com in order to post comments. Log in now.

Was this documentation topic helpful?

If you'd like to hear back from us, please provide your email address:

We'd love to hear what you think about this topic or the documentation as a whole. Feedback you enter here will be delivered to the documentation team.

Feedback submitted, thanks!