Create an SPL2 module
Use SPL2 modules to work with multiple SPL2 statements, such as searches and custom resources, while remaining in the same context.
An SPL2 module is a file that can contain multiple SPL2 statements, such as searches, custom functions, custom data types, and views that refer to specific sets of search results. Create a module if you want to work with multiple searches while remaining on the same browser tab, or write advanced searches that use custom functions and data types or refer to the results of other searches.
For more information about how SPL2 modules and statements work, see SPL2 modules and statements.
Write and run searches in an SPL2 module
Use an SPL2 module to work with multiple searches in a single browser tab.
You now have an SPL2 module that contains one or more SPL2 searches.
The following image shows an example of an SPL2 module that contains 3 searches in addition to an import statement:
Save an SPL2 module
Save your SPL2 module, and configure permissions to keep the module private or share it with other Splunk platform users.
When you save an SPL2 module, you can choose to keep the module private or allow other users of the Search & Reporting app to see, edit, or use the contents of the module.
You can navigate to the Modules page in the Search & Reporting app to see a list of all the SPL2 modules that are available to you. For more information, see Manage SPL2 modules.
There are a variety of ways that you can continue to work with the contents of your SPL2 modules. For example:
-
You can save a search as a report, alert, or dashboard. For more information, see the Creating reports, alerts, and dashboards chapter.
-
You can export a search as an SPL2 view, so that you or other users on the Splunk platform deployment can import that view into another SPL2 module and then use the search results as a dataset. For more information, see SPL2 views and the Exporting module items using SPL2 chapter.