Use XML schemas
This documentation does not apply to the most recent version of Splunk. Click here for the latest version.
Contents
Use XML schemas
Splunk 4.1 provides RelaxNG formatted schemas for the view XML, including the simplified dashboards, simplified form searches, advanced dashboards and views. Also, there are schemas available for the navigation XML, the setup XML and manager pages XML. You can find all of these schemas off the info endpoint:
http://localhost:8000/info
(Replace with your Splunk host and port.)
These schema files are written in RelaxNG compact syntax (*.rnc). But you can convert to other formats with Trang. Trang is an open source tool that lets you convert between different XML schema formats.
Here's an example of using Trang to convert from Relax to RelaxNG
java -jar trang.jar -O rng all.rnc all.rng
Files
Here's a descriptive list of all the files available from the info endpoint:
- all.rnc
- This schema file serves as a single entry point for all of the registered RelaxNG schemas. All of the schemas are written in RelaxNG compact syntax and are auto converted to the full RelaxNG schema via Trang.
- view.rnc
- This schema covers all 3 forms of view XML.
- nav.rnc
- This schema covers the app nav XML.
- manager.rnc
- These are placeholder schemas for management XML files.
- setup.rnc
- This schema covers the app setup XML.
Validation
Splunk provides a validation script, validate_all.py, located in $SPLUNK_HOME/share/splunk/search_mrsparkle/exposed/schema/. This script will inspect all of the UI XML files present under the current Splunk /etc/ directory. To validate your XML files, navigate to $SPLUNK_HOME/share/splunk/search_mrsparkle/exposed/schema/ and then enter:
$SPLUNK_HOME/bin/splunk cmd python validate_all.py
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.