evalc

Evaluates an expression for each record and updates a query parameter.

Command properties

ItemDescription
Command typeTransforming
Required permissionNone
License usageN/A
Parallel executionSupported
Distributed executionNot supported

Syntax

evalc VAR_NAME=EXPR
VAR_NAME
Query parameter name
EXPR
Expression to assign to the parameter. You can reference record fields and existing parameters.

Error codes

Parse errors
Error codeMessageDescription
20200할당자(=) 가 없습니다.The assignment operator (=) is missing
20201변수 이름이 없습니다.The parameter name is empty
20202표현식이 없습니다.The expression to assign is empty
Runtime errors

N/A

Description

The evalc command evaluates an expression for each input record and assigns the result to a query parameter. Unlike the set command, the parameter value is updated every time a record is input. You can reference the assigned parameter using the $() function.

  • The evalc command passes input records to the next command unchanged.

Examples

  1. Update a parameter based on a record field value

    table duration=1h APP_LOGS
    | evalc alert = if(count > 100000, true, $("alert"))
    

    Sets the alert parameter to true when a record with a count field exceeding 100,000 is input. The previously set alert value is retained and updated conditionally.