Skip to main content
Reference vendor/splunk 2 min read

config-json

config.json Reference

Each visualization directory requires a config.json that defines its identity, data requirements, configurable options, and editor panel.

Full structure

{
  "showTitleAndDescription": true,
  "includeInToolbar": true,
  "includeInVizSwitcher": true,
  "showDrilldown": false,
  "canSetTokens": [],
  "hasEventHandlers": false,
  "config": {
    "name": "My Visualization",
    "description": "One-line description",
    "category": "Custom",
    "icon": null,
    "dataContract": {
      "requiredDataSources": ["primary"],
      "optionalDataSources": []
    },
    "size": {
      "initialWidth": 600,
      "initialHeight": 400
    },
    "optionsSchema": {},
    "editorConfig": []
  }
}

Top-level fields

FieldTypeDescription
showTitleAndDescriptionbooleanShow the panel title/description controls in the editor
includeInToolbarbooleanShow in the Dashboard Studio visualization list
includeInVizSwitcherbooleanShow in the visualization type switcher
showDrilldownbooleanEnable drilldown support. Must be true to use addDrilldownListener or triggerDrilldown. After enabling on an already-installed app, restart Splunk — the REST layer caches config.json at startup.
canSetTokensstring[]["dynamic"], ["static"], or both. Empty array disables token-setting.
hasEventHandlersbooleanRequired alongside showDrilldown: true to activate drilldown event handling.

config fields

FieldDescription
nameDisplay name in the Splunk UI and visualization picker
descriptionShown in the visualization picker
categoryToolbar grouping label (e.g. "Custom")
iconPath to an icon image relative to the viz directory, or null for the default icon
dataContract.requiredDataSourcesUsually ["primary"] — tells Splunk a search result is required
dataContract.optionalDataSourcesAdditional named data sources the viz can consume but doesn’t require
size.initialWidth/HeightPixel dimensions when first dropped onto a dashboard
optionsSchemaDefines configurable properties and their types/defaults
editorConfigDefines the editor panel UI in the Dashboard Studio sidebar

optionsSchema

Defines the options the visualization accepts. Uses a JSON Schema subset.

"optionsSchema": {
    "barColor": {
        "type": "string",
        "default": "#4e9cf5"
    },
    "showLegend": {
        "type": "boolean",
        "default": true
    },
    "maxItems": {
        "type": "number",
        "default": 10
    }
}

Important: Defaults declared here are not guaranteed to be present at runtime. Always provide fallback values in your visualization code:

const color = options.barColor ?? '#4e9cf5';

editorConfig

Defines the sidebar editor panel. Each entry is a section with a label and a 2D layout array. Each row in layout is an array of editor widgets displayed side by side.

"editorConfig": [
    {
        "label": "Appearance",
        "layout": [
            [
                {
                    "label": "Bar color",
                    "editor": "editor.color",
                    "option": "barColor"
                }
            ],
            [
                {
                    "label": "Show legend",
                    "editor": "editor.checkbox",
                    "option": "showLegend"
                },
                {
                    "label": "Max items",
                    "editor": "editor.number",
                    "option": "maxItems"
                }
            ]
        ]
    }
]

Each widget has:

  • label — display label shown in the sidebar
  • editor — editor component type (see below)
  • option — key in optionsSchema this widget controls
  • editorProps — optional additional props (required for editor.select)

Editor types

editor valueInput typeNotes
editor.colorColor pickerReturns a hex/rgba string
editor.textText inputReturns a string
editor.numberNumeric inputReturns a number
editor.checkboxCheckbox / toggleReturns a boolean
editor.selectDropdownRequires editorProps.values — not items

Select example

{
    "label": "Alignment",
    "editor": "editor.select",
    "option": "align",
    "editorProps": {
        "values": [
            { "label": "Left",   "value": "left"   },
            { "label": "Center", "value": "center" },
            { "label": "Right",  "value": "right"  }
        ]
    }
}

Using items instead of values produces “No valid values provided to editor” in Dashboard Studio and the dropdown will be empty.


Minimal config (no options)

{
  "showTitleAndDescription": true,
  "includeInToolbar": true,
  "includeInVizSwitcher": true,
  "showDrilldown": false,
  "canSetTokens": [],
  "hasEventHandlers": false,
  "config": {
    "name": "My Viz",
    "description": "Does something useful",
    "category": "Custom",
    "icon": null,
    "dataContract": { "requiredDataSources": ["primary"], "optionalDataSources": [] },
    "size": { "initialWidth": 600, "initialHeight": 400 },
    "optionsSchema": {},
    "editorConfig": []
  }
}