App architecture and object ownership
Apps are commonly built from Splunk knowledge objects. Splunk knowledge objects include saved searches, event types, tags -- data types that enrich your Splunk deployment and make it easier to find what you need.
Any user logged into Splunk Web can create and save knowledge objects to the user's directory under the app the user is "in" (assuming that they have sufficient permissions). This is the default behavior. When a user saves an object, it goes into the user's directory in the local directory of the currently running app: $SPLUNK_HOME/etc/users/<user_name>/<app_name>/local
. When the user has saved the object in that app, it is available only to that user when they are in that app unless they do one of the following:
- Promote the object so that it is available to all users who have access.
- Restrict the object to specific roles or users (still within the app context).
- Mark the object as globally available to all apps, add-ons, and users (unless they have explicitly restricted it by role/user).
Make Splunk knowledge objects globally available
Finally, after promotion, users can decide if they want their object to be available globally, meaning that all apps are able to see it. The user must have permission to write to the original app. It's easiest to do this in Splunk Web, but a user can also do it later by moving the relevant object into the desired directory.
To make globally available an object "A" (defined in "B.conf") that belongs to user "C" in app "D":
Move the stanza defining the object A from
$SPLUNK_HOME/etc/users/C/D/B.conf
into$SPLUNK_HOME/etc/apps/D/local/B.conf
Add a setting,
export = system
, to the object A's stanza in the app'slocal.meta
file. If the stanza for that object doesn't already exist, you can just add one.
Move the [rhallen] stanza from
$SPLUNK_HOME/etc/users/fflanda/unix/local/eventtypes.conf
to$SPLUNK_HOME/etc/apps/unix/local/eventtypes.conf
- Add the following stanza to
$SPLUNK_HOME/etc/apps/unix/metadata/local.meta
:[eventtypes/rhallen] export = system
export = system
setting to local.meta
isn't necessary when you share event types from the Search app, because it exports all of its events globally by default.What objects does this apply to?
The knowledge objects discussed here are limited to those that are subject to access control. These objects are also known as app-level objects and users can view them by selecting Apps > Manage Apps from the Splunk bar. This page is available to all users to manage any objects they have created and shared. These objects include:
- Saved searches and Reports
- Event types
- Views and dashboards
- Field extractions
There are also system-level objects available only to users with admin privileges (or read/write permissions on the specific objects). These objects include:
- Users
- Roles
- Auth
- Distributed search
- Inputs
- Outputs
- Deployment
- License
- Server settings (for example: host name, port, etc)
inputs.conf
that belongs to the app you're currently in. This means that if you navigated to your app directly from Search, your input will be added to $SPLUNK_HOME/etc/apps/search/local/inputs.conf
, which might not be the behavior you desire.App configuration and knowledge precedence
When you add knowledge to Splunk, it's added in the context of the app you're in when you add it. When Splunk is evaluating configurations and knowledge, it evaluates them in a specific order of precedence, so that you can control what knowledge definitions and configurations are used in what context. Refer to About configuration files for more information about Splunk configuration files and the order of precedence.