proc

Executes the user-defined procedure.

Syntax

proc PROC_NAME(PARAMETER, ...)
Required Parameters
PROC_NAME(PARAMETER_1, PARAMETER_2, ... PARAMETER_N)
Procedure to execute and parameters in the pre-defined format. If you pass an argument to the procedure according to the parameter format defined, the argument is set to the query parameter and the query that is defined in advance is executed after. You can pass an expression that can be evaluated as a constant according to the parameter type defined by the procedure. The owner of the procedure or an authorized user executes the query with the owner permission for the procedure.

Usage

Save the query command that extracts the record of more than N% overload over the last 24 hours in the web console as a procedure. The name of the procedure here is cpu_overload. You can create a procedure query to refer to the query parameter using the $() function.

table duration=1d sys_cpu_logs
| search kernel + user >= $("threshold")

Now, you can call the procedure as follows:

proc cpu_overload(90)