Developing Dashboards, Views, and Apps for Splunk Web

 


Module reference

This documentation does not apply to the most recent version of Splunk. Click here for the latest version.

Module reference

For a general description of how to use modules, see the Module Overview.

Here you'll find all the modules you will need to build a view. Modules are organized into functional categories.

You can load dynamic descriptions of all the modules in your Splunk instance by hitting the following URI:

http://localhost:8000/en-US/modules

Note: Replace host and port with your installation specifics.

Nav

There are four basic modules for page layout and general page properties.

AccountBar

The bar at the top of most views, that contains the logo, says logged in as <user>, and contains the logout and admin links.

AppBar

This is the bar second from the top in most views. It contains the top level view categories (by default Dashboards Views Saved Searches), and the auxiliary links section (help | preferences | about)

TitleBar

Control menu/actions menu.

This module is persistent, and contains information such as the name of the dashboard, the name of the view, or the name of the view and associated saved search. The titlebar functions as a place for contextual actions, like saving a new search that has been run after loading a view.

Params

Required

None.

Optional

Messaging

This module can display all messages to the user, or can be configured to display just a certain class of messages. Messages might come from searches, alerts, errors, information about indexing status, etc. Each view should have at least one message module to receives messages from the back-end.

Message

This module can display all messages to the user, or can be configured to display just a certain class of messages. Messages might come from searches, from alerts firing, from misconfiguration on the backend, from information about indexing status etc.

The simplest configuration is a single Message instance with filter set to '*' -- meaning it will display all the messages broadcast. However, you can use multiple Message modules with different 'filter' params displayed in separate layout panels throughout a view.

Messages are passed with a defined class, such as splunk.search.error. So if you have two Message instances, one configured with a filter of '*', and another with a filter of splunk.search, the latter will receive the splunk.search.error events, and the "*" instance will not. However when an unexpected message is passed down with the class of splunk.indexing.warn, the splunk.search instance will not display it but the the '*' instance will.

Params

Required

Optional

Example

<module name="Message">
  <param name="filter">*</param>
  <param name="clearOnJobDispatch">False</param>
  <param name="maxSize">1</param>
</module>

Search

Modules for search actions.

Descendant modules pick up information passed along by their parents, so each descendant search module adds its own options to the original search. Refine any search by including child modules that add filters, such as fields or time ranges.

SearchBar

The SearchBar module creates a search bar with cancel and submit buttons.

DevModule-searchfield.png

Params

Required

None.

Optional

Example

<module name="SearchBar">
  <param name="q">host=*</param>
  <param name="autoRun">True</param>

This example prepopulates the search bar and automatically dispatches the search:

host=*

FieldSearch

Restrict searches to a specific field. Use this module to configure a form search with only one form field. To configure form searches with multiple forms, use ExtendedFieldSearch (below).

DevModule-simplesearchfield.png

Params

Required

Optional

Example

<module name="FieldSearch">
  <param name="field">sourcetype</param>

ExtendedFieldSearch

Restrict searches to a specific field. Use this module to configure a form search with multiple form fields. To configure form searches with a single field, use FieldSearch (above).

Params

Required

Optional

Example

 <module name="HiddenSearch">
   <param name="search">sourcetype=$st$</param>
   <module name="ExtendedFieldSearch">
     <param name="intention">
       <param name="name">stringreplace</param>
       <param name="arg">
           <param name="st">
               <param name="default">apache_error</param>
           </param>
       </param>
     </param>
     <param name="replacementMap">
       <param name="arg">
         <param name="st">
             <param name="value"></param>
         </param>
       </param>
     </param>
     <param name="field">Sourcetype</param>
   </module>
 </module>

ViewRedirector

This module takes the context and settings information provided by its ancestors, dispatches the search and redirects the user to see that search in the specified view. When ViewRedirector receives a new context, and onContextChange() is called, it WILL REDIRECT to the specified view.

params

Required

Optional

Example

 
<module name="ViewRedirector">
  <param name="viewTarget">flashtimeline</param>
</module>

ViewRedirectorLink

This module puts a link in the view with the given label. When clicked it will take the context information provided by its ancestors, dispatch the search and redirects the user to see that search in the specified view.

Params

ViewRedirectorLink inherits all the params from ViewRedirector (above).

Required

None.

Optional

HiddenSearch

Runs a search behind the scenes. Passes results on to any children.

Note:

Params

Required

Optional

Note: Read more about configuring valid time strings

Example

<module name="HiddenSearch">
  <param name="search">| metadata type=sources | sort -totalCount</param>

HiddenSavedSearch

Loads results from a saved search, configured in savedsearches.conf. Either runs the saved search upon load or displays results from the last scheduled run of the saved search.

Note: You must schedule your saved search to run

Params

Required

Optional

Example

This example uses a saved search named "All local sources."

<module name="HiddenSavedSearch" autoRun="true">
  <param name="savedSearch">All local sources</param>

HiddenIntention

Adds an intention to any search it receives.

Params

Required

Optional

None.

Example

HiddenFieldPicker

This module implements an invisible control that hardwires which fields the user will see and what order those fields are in. When they are descendants of this module, other modules that display events and summary information will pick up the field list specified here.

Params

Required

Optional

None.

Example

<module name="HiddenFieldPicker">
  <param name="fields">clientip host uri</param>

RadioButtonSearch

This module creates a set of radio buttons with submit and cancel buttons.

Note: Requires HiddenSearch as a parent (or ancestor).

Params

Required

Optional

Example

<module name="RadioButtonSearchField">
  <param name="options">
    <list>
      <param name="selected">true</param>
      <param name="value">save</param>
      <param name="text">Saves</param>
    </list>
    <list>
      <param name="value">edit</param>
      <param name="text">Edits</param>
    </list>
    <list>
      <param name="value">upload</param>
      <param name="text">Uploads</param>
    </list>
    <list>
      <param name="value">view</param>
      <param name="text">Views</param>
    </list>
    <list>
      <param name="value"></param>
      <param name="text">All</param>
    </list>
  </param>
<param name="label">Show only</param>

TimeRangePicker

This module creates a drop-down menu that users can use to change the timerange. Timerange values and labels are pulled from the configuration in times.conf.

DevModule-timerangepicker.png

Params

Required

None.

Optional

Optional

required = False label = Optional label to display above time range picker.

Example

<module name="TimeRangePicker">
  <param name="selected">This month</param>

FieldPicker

This module launches the field picker, a list of all available fields from which a user can select the fields to display. Descendants of this module that display events and summary information will pick up the field list specified or chosen here.

Params

Required

Optional

None.

Example

<module name="FieldPicker">
  <param name="fields">host sourcetype source</param>

Switchers

Switcher modules let you switch between options, such as results displays or other groups of child modules, without switching views. Only one group of child modules is shown at a time. Switcher modules are buttons, pulldown menus, links and tabs.

All switcher modules share these params:

Required

Optional

PulldownSwitcher

Creates a pull-down menu populated with results from its children. Shows one set of child modules at a time. Children can be serialized -- they pass results on -- or independent.

Params

Default switcher params noted above.

Required

Example

<module name="PulldownSwitcher">
  <param name="mode">independent</param>
  <param name="selected">Messages per minute last hour</param>
  <param name="label">Show: </param>

TabSwitcher

Like PulldownSwitcher, this module shows only one child at a time. Displays the results of its child modules in a set of tabs. When the user clicks a different tab, the corresponding child and its descendant modules are shown on screen and all other child modules (and descendants thereof) are hidden.

Params

Default switcher params noted above.

Example

<module name="TabSwitcher">
  <param name="mode">independent</param>

ButtonSwitcher

Switches between displays based on clicking an icon. Mainly used for switching between viewing results in events view or table view. The button style is determined by a class set in the params.

When the user clicks a different button, the corresponding child and its descendant modules will be shown on screen and all other child modules (and descendants thereof) will be hidden.

Params

Default switcher params noted above.

LinkSwitcher

When the user clicks a different link, the corresponding child and its descendant modules will be shown on screen and all other child modules (and descendants thereof) will be hidden.

Params

Default switcher params noted above.

Required

Example

<module name="LinkSwitcher">
   <param name="mode">serializeAll</param>
   <param name="label">Format options:</param>

Results

To pass a search on as results, format your results modules as children of previous search modules.

GenericHeader

Displays a header. Frequently used in combination with switcher modules (eg TabSwitcher and PulldownSwitcher) to display a label for children modules.

Params

Required

Optional

None.

Example

<module name="GenericHeader">
  <param name="switcherTitle">General Options</param>
  <param name="label">General Options</param>


ResultsHeader

The ResultsHeader module creates a label for your results. Use this module to create headers for other modules (these should be children of the ResultsHeader). This module displays a header, for example 23,420 events. Generally placed above a FlashTimeline or above a set of modules implementing paging controls.

DevModule-resultsheader.png

Params

Required

Optional

This is a dictionary of config values that specifies behavior for a link that the module can show, that sends the user to a different view where this search result will be displayed instead. Contains a 'label' key that is the text of the link, and a 'viewTarget' key that is the view to which the user should be sent. And also a 'popup' key that when True will make the link open a new popup window.

Example

<module name="ResultsHeader">
  <param name="entityName">events</param>
  <param name="prefix">Timeline</param>
  <param name="entityLabel">Events</param>


<module name="ResultsHeader">
  <param name="entityLabel">Events</param>
  <param name="link">
    <param name="popup">True</param>
    <param name="viewTarget">report_wizard</param>
    <param name="label">Report on results</param>
  </param>
  <param name="prefix">Timeline</param>
  <param name="entityName">events</param>

EventsViewer

The EventsViewer module displays events resulting from the search that its ancestor modules combined to specify. This module is very similar to SimpleEventsViewer, and one of these two modules will in the future be folded into the other.

Params

Required

None.

Optional

Example

<module name="EventsViewer"/>

SingleValue

This module waits for the search to complete and then renders a single field from the first row of the results.

Params

Required

None.

Optional


SimpleFieldViewer

This module shows the top N values for a given field, along with the number of events that have the given value.

Params

Required

Optional

Example

<module name="SimpleFieldViewer">
  <param name="count">5</param>
  <param name="field">twikiuser</param>
</module>

MultiFieldViewer

Top x values of multiple fields.

Shows a set of field names, with distinct counts next to them in parentheses. When the user clicks on the field names, a popup layer opens, showing the top 10 values for that field. Clicking then on one of those values will add the proper field=value term and re run the search.

Params

Required

None.

Optional

Example

<module name="MultiFieldViewer">
  <param name="count">10</param>
  <param name="link">
    <param name="view">report_wizard</param>
    <param name="label">Report on this field</param>
  </param>

LinkList

Renders a list of links. Link lists are generally a combination of a primary field (labelField) and a second, descriptive field (valueField). Optionally specify display params.

Note: Requires HiddenSearch as a parent.

DevModule-linklist.png

Params

Required

Optional

Example

<module name="LinkList">
   <param name="initialSortDir">desc</param>
   <param name="labelFieldSearch">*</param>
   <param name="valueField">totalCount</param>
   <param name="labelField">source</param>
   <param name="labelFieldTarget">searchview</param>
   <param name="initialSort">totalCount</param>

Chart controls

If you want to chart your results, use these modules.

FlashChart

This module contains a Flash object that is capable of charting almost any search results that the Splunk backend can generate.

The FlashChart module displays your results in a chart.

DevModule-flashchart.png


Params

Required

Optional

Example

<module name="FlashChart">
  <param name="height">300px</param>
  <param name="width">100%</param>

FlashTimeline

This module contains a Flash object that is capable of displaying a chart of number of events over time. This chart will be updated asynchronously while the search is running.

The FlashTimeline module renders the timeline.

DevModule-flashtimeline.png

Params

Required

Optional

Example

<module name="FlashTimeline">
  <param name="height">180px</param>
  <param name="width">100%</param>

SimpleResultsTable

Waits for the search to complete, and then renders its final results in a tabular format.

Params

Required

None.

Optional

Example

<module name="SimpleResultsTable"/>

HiddenChartFormatter

This module contains a pulldown that you can use to change between 'column', 'line', 'area' and various other chart types.

Params

Required

None.

Optional

Example

<module name="HiddenChartFormatter">
  <param name="chart">line</param>
  <param name="chartTitle">CPU performance in the past 24 hours</param>

Page Controls

Special settings for formatting events on the page.

Count

Events per page.

Note: When used in conjunction with a Paginator module, the Paginator should be a descendent of the Count module, not an ancestor.

Params

Required

Optional

None.

Example

<module name="Count">
  <param name="switcherTitle">As List</param>
  <param name="options">
    <list>
      <param name="text">10</param>
      <param name="value">10</param>
    </list>
    <list>
      <param name="text">20</param>
      <param name="selected">True</param>
      <param name="value">20</param>
    </list>
    <list>
      <param name="text">50</param>
      <param name="value">50</param>
    </list>
  </param>

MaxLines

Max lines per event. Create a drop-down that lets you decide between any specified numbers of max lines.

Params

Required

Optional

None.

Example

   
<module name="MaxLines">
  <param name="options">
     <list>
        <param name="text">5</param>
        <param name="selected">True</param>
        <param name="value">5</param>
     </list>
     <list>
       <param name="text">10</param>
       <param name="value">10</param>
    </list>
    <list>
      <param name="text">20</param>
      <param name="value">20</param>
    </list>
    <list>
      <param name="text">50</param>
      <param name="value">50</param>
    </list>
    <list>
      <param name="text">100</param>
      <param name="value">100</param>
    </list>
    <list>
      <param name="text">200</param>
      <param name="value">200</param>
    </list>
    <list>
      <param name="text">All</param>
      <param name="value">0</param>
    </list>
  </param>

Paginator

DevModule-paginator.png

Splits events into separate pages and displays a series of links to page around in your data. It must be configured to page either through the 'events' or the 'results' of your search.

Note: It is a good idea to precede EventsViewer with Paginator -- eg EventsViewer is a child of Paginator -- otherwise only one page of events will be displayed.

Params

Required

Optional

Example

<module name="Paginator">
  <param name="count">100</param>
  <param name="entityName">results</param>
  <param name="switcherTitle">As Table</param>
  <param name="maxPages">10</param>

Segmentation

Set the segmentation type for events.

Params

[param:options] required = True label = This is a list whose items have two required keys, 'text' and 'value'. 'value can be one of raw,inner,outer,full.


Required

Optional

Example

<module name="Segmentation">
  <param name="options">
    <list>
      <param name="text">inner</param>
      <param name="selected">True</param>
      <param name="value">inner</param>
    </list>
    <list>
      <param name="text">outer</param>
      <param name="value">outer</param>
    </list>
    <list>
      <param name="text">full</param>
      <param name="value">full</param>
    </list>
    <list>
      <param name="text">raw</param>
      <param name="value">raw</param>
    </list>
  </param>

SoftWrap

Display a checkbox to toggle soft-wrapping of events. When off, event text breaks in the page only where there is a linebreak in the actual data, and scrollbars appear as necessary. When on, the event text also breaks at the edge of the window.

Params

Required

None.

Optional

Example

<module name="SoftWrap">
  <param name="switcherTitle">As List</param>

Include

Use the following modules to add web resources to your view.

ServerSideInclude

Supports server side includes for custom content. Additionally, the Mako (see: http://www.makotemplates.org/) template language is supported.

Caution: Splunk's CSS is not scoped. If you want to add CSS to your page, make sure you scope your CSS or you will overwrite Splunk's default CSS.

Params

Required

Optional

None.

Example

<module name="ServerSideInclude">
  <param name="src">hello_world.html</param>
</module>

IFrameInclude

Set up an inline frame (iframe) to show content from another URL.

Params

Required

Optional

Example

<module name="IFrameInclude">
  <param name="src">http://www.google.com</param>
</module>

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.


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

Was this documentation topic helpful?

If you'd like to hear back from us, please provide your email address:

We'd love to hear what you think about this topic or the documentation as a whole. Feedback you enter here will be delivered to the documentation team.

Feedback submitted, thanks!