evalc
Evaluates an expression for each record and updates a query parameter.
Command properties
| Item | Description |
|---|---|
| Command type | Transforming |
| Required permission | None |
| License usage | N/A |
| Parallel execution | Supported |
| Distributed execution | Not 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 code | Message | Description |
|---|---|---|
| 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
evalccommand passes input records to the next command unchanged.
Examples
-
Update a parameter based on a record field value
table duration=1h APP_LOGS | evalc alert = if(count > 100000, true, $("alert"))Sets the
alertparameter totruewhen a record with acountfield exceeding 100,000 is input. The previously setalertvalue is retained and updated conditionally.