By default, each visualization in this repo is a standalone Splunk app. But you can also embed visualizations into an existing app — useful when you want to ship vizs alongside dashboards, saved searches, or other app content without requiring separate installs.
There are two approaches:
| Approach | Best for |
|---|---|
| Automated build pipeline | New apps or apps that will bundle multiple vizs. Handles building, merging configs, version bumping, and packaging automatically. |
| Manual embedding | Adding a single viz to an existing app quickly. |
Use the /splunk-viz skill to scaffold a complete Dashboard Studio app with a vizs/ build pipeline. This generates:
your_app/
.gitignore
default/
app.conf
visualizations.conf ← populated by build.sh
savedsearches.conf ← populated by build.sh
data/ui/views/ ← your dashboards
metadata/
default.meta ← viz exports added by build.sh
README/
savedsearches.conf.spec ← populated by build.sh
vizs/
build.sh ← builds, merges, packages
harness-manifest.json ← test harness registry
test-harness.html ← browser-based testing
my_first_viz/ ← standalone viz app (source)
my_second_viz/ ← standalone viz app (source)
appserver/
static/
visualizations/
my_first_viz/ ← build output (merged)
my_second_viz/ ← build output (merged)
Each viz lives under vizs/ as a standalone Splunk app with its own default/, metadata/, and source code. The vizs/build.sh script:
- Builds each viz (npm install + webpack)
- Merges the compiled output (
visualization.js,visualization.css,formatter.html) into the parent app'sappserver/static/visualizations/ - Consolidates config stanzas from each viz into the parent app's
visualizations.conf,savedsearches.conf,savedsearches.conf.spec, anddefault.meta - Bumps the app version in
app.conf - Packages the app into a
.tar.gztarball (excludingvizs/,node_modules/, and dev files)
Using /splunk-viz, scaffold a Splunk Dashboard Studio app called "my_app"
with custom visualization support.
Scaffold individual vizs into the vizs/ directory using the normal /splunk-viz workflow, then add the viz name to the APPS array in vizs/build.sh and the vizs array in vizs/harness-manifest.json.
./vizs/build.sh # Build and merge all vizs
./vizs/build.sh my_first_viz # Build and merge one vizThe tarball is output to the parent directory: ../{app_name}.tar.gz
cd vizs && python3 -m http.server 8080Open http://localhost:8080/test-harness.html — the harness discovers all vizs from harness-manifest.json.
For adding a single viz to an existing app without the full build pipeline.
Copy the visualization files into your existing app, preserving this layout:
your_existing_app/
default/
app.conf (already exists)
visualizations.conf (add viz stanza)
savedsearches.conf (add example search, optional)
metadata/
default.meta (add viz export)
README/
savedsearches.conf.spec (add viz settings)
appserver/
static/
visualizations/
{viz_name}/
visualization.js (built webpack bundle)
visualization.css
formatter.html
You only need the built visualization.js — not the src/, node_modules/, webpack.config.js, or package.json files. Those stay in this repo for development.
From this repo's root:
./build.sh {viz_name}# Create the viz directory in your app
mkdir -p $SPLUNK_HOME/etc/apps/your_app/appserver/static/visualizations/{viz_name}
# Copy the three required viz files
cp examples/{viz_name}/appserver/static/visualizations/{viz_name}/visualization.js \
$SPLUNK_HOME/etc/apps/your_app/appserver/static/visualizations/{viz_name}/
cp examples/{viz_name}/appserver/static/visualizations/{viz_name}/visualization.css \
$SPLUNK_HOME/etc/apps/your_app/appserver/static/visualizations/{viz_name}/
cp examples/{viz_name}/appserver/static/visualizations/{viz_name}/formatter.html \
$SPLUNK_HOME/etc/apps/your_app/appserver/static/visualizations/{viz_name}/In your app's default/visualizations.conf, add:
[{viz_name}]
label = {Display Label}
description = {Description}
default_height = 400
allow_user_selection = true
disabled = 0
search_fragment = {example SPL fragment}The stanza name must match the directory name under appserver/static/visualizations/.
In your app's metadata/default.meta, add:
[visualizations/{viz_name}]
export = systemWithout this, the visualization will only be visible within your app's dashboards.
In your app's README/savedsearches.conf.spec, add every custom setting from the viz's formatter:
display.visualizations.custom.your_app.{viz_name}.setting1 = <string>
display.visualizations.custom.your_app.{viz_name}.setting2 = <boolean>Important: The namespace changes when embedding. The setting prefix becomes your_app.{viz_name} instead of {viz_name}.{viz_name}. This is because Splunk uses the app name (not the viz app name) as the first part of the namespace.
$SPLUNK_HOME/bin/splunk restartThe visualization will now appear in the viz picker across all apps.
When using the embedded viz in saved searches or dashboard XML, the custom type reference uses your app name:
display.visualizations.custom.type = your_app.{viz_name}You can embed multiple vizs in the same app. Each one gets its own directory under appserver/static/visualizations/ and its own stanza in visualizations.conf:
your_existing_app/
appserver/
static/
visualizations/
custom_single_value/
visualization.js
visualization.css
formatter.html
component_status_board/
visualization.js
visualization.css
formatter.html
When bundling multiple vizs, make sure every viz's custom settings are listed in the single README/savedsearches.conf.spec file in your app. Missing entries cause splunk btool check errors.
When the visualization source changes:
- Rebuild in this repo:
./build.sh {viz_name} - Copy the updated
visualization.jsto your app - Navigate to
http://<splunk>:8000/en-US/_bumpand click "Bump version" - Hard-refresh the browser (Cmd+Shift+R / Ctrl+Shift+R)
No Splunk restart needed unless you changed visualizations.conf or savedsearches.conf.