App Framework Reference

Splunk API

Splunk.Context

The Splunk.Context class encapsulates the shared Splunk view context, which is instantiated when a view is created. Modules share the context to communicate search and state event changes, and to handle events, hierarchically.

Language Binding

JavaScript

Declaration

$SPLUNK_HOME/share/search_mrsparkle/exposed/js/context.js

Implementation Location

$SPLUNK_HOME/etc/apps/ <appName> /appserver/modules/ <moduleName>

Constructor

Methods

clone() Creates a new context object, copying the current context.
enforceByValue() Ensures that the get(), getAll(), and set() methods return objects by value.
get() Gets all named keys in an instantiated context. A generic getter.
getAll() Gets all values at or below the specified name parameter. A generic getter.
has() Checks if the context contains the specified key name.
set() Sores the specified value for the specified key name. A generic setter.