Importing SPL command functions
To use the SPL command functions you must import the functions into your modules.
The SPL command functions are located in the /system/compat
path.
Import a single SPL command function
To import a single command function, such as makeresults
, specify that function in the import statement. For example:
import makeresults from /system/compat
Import multiple SPL command functions
To import multiple command functions, specify a comma-separated list of the names of the command functions inside a set of curly brackets { } in the import statement. For example:
import {makeresults, spath, tstats} from /system/compat
Import all of the SPL command functions
To import all of the command functions in the SPL compatibility library, use the wildcard ( * ) character in the import statement. For example:
import * from /system/compat
Import functions used with the convert command function
The convert
has additional functions that you can use with the command function. To import these additional functions, specify those functions in the import statement. The following example imports the convert
command function and the dur2sec
function that the convert
command function uses:
import {convert, dur2sec} from /system/compat
See also
- Related information
- Using SPL command functions
- Compatibility library for SPL commands as functions
Compatibility library for SPL commands as functions | Using SPL command functions |
This documentation applies to the following versions of Splunk® Cloud Services: current
Feedback submitted, thanks!