Advanced view building
This documentation does not apply to the most recent version of Splunk. Click here for the latest version.
Contents
Advanced view building
Every page in Splunk Web is custom built. These pages, or views, are XML files stored in an App's view directory. Views are made out of a library of modules. Every module is actually a directory of CSS, JavaScript, HTML and, in some cases, Python and Flash.
Views can be modified to fit your specifications. Or, you can create your own views from scratch. If you're just starting out, check out the simplified view XML described earlier in this manual. You should only use the advanced XML if you've tried the simple XML and it doesn't support your use case. For example, if you want to build a search view, or you want to use modules that aren't available to the simple XML.
Here's a general outline of the basic concepts for configuring views:
- Decide which modules you want to include in your view.
- Configure each module in
<view_name>.xml. - Put
<view_name>.xmlin the views directory, inside your app directory:$SPLUNK_HOME/etc/apps/<App_name>/data/ui/views/ - If you have more than one view for your App, arrange them in the UI by following the instructions in Create view collections.
- To change the CSS for a view, Change your app's style.
Note: If you're customizing your App by modifying the xml outside of Splunk Manager, you can reload the configs by navigating to the following.
Get a brand new view to show up:
https://localhost:8089/services/apps/local?refresh=true
(against the Splunkd management port)
Reload a specific view:
https://localhost:8089/services/apps/local/<appname>?refresh=true
(against the Splunkd management port)
Reload all views:
http://localhost:8000/app/<appname>/
(against the SplunkWeb UI port)
Types of views
There are three main types of views: dashboards, form searches and search views. Each type of view is defined by a Mako template, located in $SPLUNK_HOME/share/splunk/search_mrsparkle/templates/view/. Mako templates are HTML files with support for Python. Splunk's templates define page layout; basically, how each element fits into a page.
Dashboards
- Build a dashboard
- Dashboards are useful for presenting visual summaries of various searches.
- Learn more about dashboards here.
Form searches
- Build a form search
- Form searches let you restrict the search interface to present one or more search boxes with more complex searches running behind the scenes.
- There's more information here.
Search views
- Build a search view
- Search views are pages that let you run a search and interact with search results.
- Learn more about how to build a search view here.
More Splunk Web customizations
Customize your App's look and feel. Here are a few things you can do:
- Change the menu layout.
- Add your own custom HTML and JavaScript.
- Skin your App with custom CSS.
Learn more about what you can do here.
Types of modules
There are a number of modules from which you can build your view. For example, the search bar within a page is one module. Modules also include graphs and charts, text entry boxes, links, drop-down menus and other components. For a general overview of how modules work, read How modules work.
Modules live in $SPLUNK_HOME/share/splunk/search_mrsparkle/modules/. For a complete list, see the Module reference. Or, append ?showsource=true to any view's URL to see the hierarchy of modules in the page. For example:
http://localhost:8000/en-US/app/search/charting?showsource=true
Note: Replace localhost:8000 with your installation host and port.
This documentation applies to the following versions of Splunk: 4.0 , 4.0.1 , 4.0.2 , 4.0.3 , 4.0.4 , 4.0.5 , 4.0.6 , 4.0.7 , 4.0.8 , 4.0.9 , 4.0.10 , 4.0.11 View the Article History for its revisions.