Splunk® Enterprise

Splunk Dashboard Studio

Acrobat logo Download manual as PDF


This documentation does not apply to the most recent version of Splunk® Enterprise. For documentation on the most recent version, go to the latest release.
Acrobat logo Download topic as PDF

Dropdown

Use this input to let users choose one option from a dropdown menu. Use multiselect inputs to let users make multiple selections at once. You can populate dropdown inputs using either static values or create them dynamically using search results. You can add up to, and including, 1,000 dropdown menu options.

To create a static menu, you must define the key/value pairs: label and value. The label is what the user chooses from the menu and the value is what is passed to the token when selected.

The following options are available to use in the options field:

  • defaultValue
  • token
  • items
  • selectFirstSearchResult
    • When a search generates the dropdown content, this sets the default value as the first search result returned.

The following example contains two dropdown inputs. One is a time range picker, and the second provides a selection of different HTTP request methods:

A dashboard with dropdown and multiselect inputs. Some have static options, some menus are populated by search results.

Expand this window to copy/paste the dashboard definition into your own dashboard.

 {
   "visualizations": {
       "viz_1BAm6ljX": {
           "type": "splunk.line",
           "dataSources": {
               "primary": "ds_6v2nFTBZ"
           },
           "showProgressBar": false,
           "showLastUpdated": false,
           "title": "Activity by Status",
           "description": ""
       }
   },
   "dataSources": {
       "ds_ljNWYr7J": {
           "type": "ds.search",
           "options": {
               "query": "index=_internal \n|  stats count by method"
           },
           "name": "Method"
       },
       "ds_6v2nFTBZ": {
           "type": "ds.search",
           "options": {
               "query": "index=_internal method=\"$method$\" \n| timechart count by status"
           },
           "name": "Status codes per method"
       }
   },
   "defaults": {
       "dataSources": {
           "ds.search": {
               "options": {
                   "queryParameters": {
                       "latest": "$global_time.latest$",
                       "earliest": "$global_time.earliest$"
                   }
               }
           }
       }
   },
   "inputs": {
       "input_global_trp": {
           "type": "input.timerange",
           "options": {
               "token": "global_time",
               "defaultValue": "-24h@h,now"
           },
           "title": "Global Time Range"
       },
       "input_08lrAW9u": {
           "options": {
               "items": ">frame(label, value) | prepend(formattedStatics) | objects()",
               "defaultValue": "*",
               "token": "method"
           },
           "title": "Select Method",
           "type": "input.dropdown",
           "dataSources": {
               "primary": "ds_ljNWYr7J"
           },
           "context": {
               "formattedConfig": {
                   "number": {
                       "prefix": ""
                   }
               },
               "formattedStatics": ">statics | formatByType(formattedConfig)",
               "statics": [
                   [
                       "All"
                   ],
                   [
                       "*"
                   ]
               ],
               "label": ">primary | seriesByName(\"method\") | renameSeries(\"label\") | formatByType(formattedConfig)",
               "value": ">primary | seriesByName(\"method\") | renameSeries(\"value\") | formatByType(formattedConfig)"
           }
       }
   },
   "layout": {
       "type": "grid",
       "options": {},
       "structure": [
           {
               "item": "viz_1BAm6ljX",
               "type": "block",
               "position": {
                   "x": 0,
                   "y": 0,
                   "w": 1200,
                   "h": 400
               }
           }
       ],
       "globalInputs": [
           "input_global_trp",
           "input_08lrAW9u"
       ]
   },
   "description": "",
   "title": "Inputs Examples - Dropdown"
}
Last modified on 23 February, 2023
PREVIOUS
Input conversion
  NEXT
Multiselect

This documentation applies to the following versions of Splunk® Enterprise: 9.0.0, 9.0.1, 9.0.2, 9.0.3, 9.0.4, 9.0.5, 9.0.6, 9.0.7, 9.0.8


Was this documentation topic helpful?


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

Please try to keep this discussion focused on the content covered in this documentation topic. If you have a more general question about Splunk functionality or are experiencing a difficulty with Splunk, consider posting a question to Splunkbase Answers.

0 out of 1000 Characters