op_if(Condition 1, Value 1, Value 2)
Parameter | Description | Type | Required | Default Value | Value Range |
condition | Condition expression | bool | Yes | - | - |
data1 | If the condition is True , the value of this parameter is returned. | string | Yes | - | - |
data2 | If the condition is False , the value of this parameter is returned. | string | Yes | - | - |
{"data": "abc"}
fields_set("result", op_if(True, v("data"), "false"))
{"result":"abc","data":"abc"}
{"data": "abc"}
fields_set("result", op_if(False, v("data"), "123"))
{"result":"123","data":"abc"}
True
is returned. Otherwise, False
is returned.op_and(Value 1, Value 2, ...)
Parameter | Description | Type | Required | Default Value | Value Range |
Variable parameter list | Parameters or expressions that participate in the calculation | string | Yes | - | - |
{}
fields_set("result", op_and(True, False))
{"result":"false"}
{}
fields_set("result", op_and(1, 1))
{"result":"true"}
{"data":"false"}
fields_set("result", op_and(1, v("data")))
{"result":"false","data":"false"}
False
is returned. Otherwise, True
is returned.op_or(Value 1, Value 2, ...)
Parameter | Description | Type | Required | Default Value | Value Range |
Variable parameter list | Parameters or expressions that participate in the calculation | string | Yes | - | - |
{}
fields_set("result", op_or(True, False))
{"result":"true"}
op_not(Value)
Parameter | Description | Type | Required | Default Value | Value Range |
data | Value of any type | any | Yes | - | - |
{}
fields_set("result", op_not(True))
{"result":"false"}
{}
fields_set("result", op_not("True"))
{"result":"false"}
True
is returned.op_eq(Value 1, Value 2)
Parameter | Description | Type | Required | Default Value | Value Range |
data1 | Numeric value or string that can be converted to a numeric value | number | Yes | - | - |
data2 | Numeric value or string that can be converted to a numeric value | number | Yes | - | - |
Post
and Get
fields are equal
Raw log:{"Post": "10", "Get": "11"}
fields_set("result", op_eq(v("Post"), v("Get")))
result
.
Processing result:{"result":"false","Post":"10","Get":"11"}
field1
and field2
fields are equal
Raw log:{"field1": "1", "field2": "1"}
fields_set("result", op_eq(v("field1"), v("field2")))
{"result":"true","field1":"1","field2":"1"}
Value 1
is greater than or equal to Value 2
, True
is returned.op_ge(Value 1, Value 2)
Parameter | Description | Type | Required | Default Value | Value Range |
data1 | Numeric value or string that can be converted to a numeric value | number | Yes | - | - |
data2 | Numeric value or string that can be converted to a numeric value | number | Yes | - | - |
{"field1": "20", "field2": "9"}
fields_set("result", op_ge(v("field1"), v("field2")))
{"result":"true","field1":"20","field2":"9"}
{"field1": "2", "field2": "2"}
fields_set("result", op_ge(v("field1"), v("field2")))
{"result":"true","field1":"2","field2":"2"}
Value 1
is greater than Value 2
, True
is returned.op_gt(Value 1, Value 2)
Parameter | Description | Type | Required | Default Value | Value Range |
data1 | Numeric value or string that can be converted to a numeric value | number | Yes | - | - |
data2 | Numeric value or string that can be converted to a numeric value | number | Yes | - | - |
{"field1": "20", "field2": "9"}
fields_set("result", op_ge(v("field1"), v("field2")))
{"result":"true","field1":"20","field2":"9"}
Value 1
is less than or equal to Value 2
, True
is returned.op_le(Value 1, Value 2)
Parameter | Description | Type | Required | Default Value | Value Range |
data1 | Numeric value or string that can be converted to a numeric value | number | Yes | - | - |
data2 | Numeric value or string that can be converted to a numeric value | number | Yes | - | - |
{"field1": "2", "field2": "2"}
fields_set("result", op_le(v("field1"), v("field2")))
{"result":"true","field1":"2","field2":"2"}
Value 1
is less than Value 2
, True
is returned.op_lt(Value 1, Value 2)
Parameter | Description | Type | Required | Default Value | Value Range |
data1 | Numeric value or string that can be converted to a numeric value | number | Yes | - | - |
data2 | Numeric value or string that can be converted to a numeric value | number | Yes | - | - |
{"field1": "2", "field2": "3"}
fields_set("result", op_lt(v("field1"), v("field2")))
{"result":"true","field1":"2","field2":"3"}
op_add(Value 1, Value 2)
Parameter | Description | Type | Required | Default Value | Value Range |
data1 | Numeric value or string that can be converted to a numeric value | number | Yes | - | - |
data2 | Numeric value or string that can be converted to a numeric value | number | Yes | - | - |
{"field1": "1", "field2": "2"}
fields_set("result", op_add(v("field1"), v("field2")))
{"result":"3","field1":"1","field2":"2"}
Parameter | Description | Type | Required | Default Value | Value Range |
data1 | Numeric value or string that can be converted to a numeric value | number | Yes | - | - |
data2 | Numeric value or string that can be converted to a numeric value | number | Yes | - | - |
{"field1": "1", "field2": "2"}
fields_set("result", op_sub(v("field1"), v("field2")))
{"result":"-1","field1":"1","field2":"2"}
op_mul(Value 1, Value 2)
Parameter | Description | Type | Required | Default Value | Value Range |
data1 | Numeric value or string that can be converted to a numeric value | number | Yes | - | - |
data2 | Numeric value or string that can be converted to a numeric value | number | Yes | - | - |
{"field1": "1", "field2": "2"}
fields_set("result", op_mul(v("field1"), v("field2")))
{"result":"2","field1":"1","field2":"2"}
op_div(Value 1, Value 2)
Parameter | Description | Type | Required | Default Value | Value Range |
data1 | Numeric value or string that can be converted to a numeric value | number | Yes | - | - |
data2 | Numeric value or string that can be converted to a numeric value | number | Yes | - | - |
{"field1": "1", "field2": "2"}
fields_set("result", op_div(v("field1"), v("field2")))
{"result":"0","field1":"1","field2":"2"}
{"field1": "1.0", "field2": "2"}
fields_set("result", op_div(v("field1"), v("field2")))
{"result":"0.5","field1":"1.0","field2":"2"}
op_sum(Value 1, Value 2, ...)
Parameter | Description | Type | Required | Default Value | Value Range |
Variable parameter list | Numeric value or string that can be converted to a numeric value | string | Yes | - | - |
{"field1": "1.0", "field2": "10"}
fields_set("result", op_sum(v("field1"), v("field2")))
{"result":"11.0","field1":"1.0","field2":"10"}
op_mod(Value 1, Value 2)
Parameter | Description | Type | Required | Default Value | Value Range |
data1 | Numeric value or string that can be converted to a numeric value | number | Yes | - | - |
{"field1": "1.0", "field2": "0"}
fields_set("result", op_mod(v("field1"), v("field2")))
{"result":"2","field1":"1","field2":"2"}
{"field1": "1.0", "field2": "5"}
fields_set("result", op_mod(v("field1"), v("field2")))
{"result":"1.0","field1":"1.0","field2":"5"}
{"field1": "6", "field2": "4"}
fields_set("result", op_mod(v("field1"), v("field2")))
{"result":"2","field1":"6","field2":"4"}
null
. If so, true
is returned; otherwise, false
is returned.op_null(Value)
Parameter | Description | Type | Required | Default Value | Value Range |
data | Value of any type | any | Yes | - | - |
{}
fields_set("result", op_null("null"))
{"result":"true"}
{"data": null}
fields_set("result", op_null(v("data")))
{"data": "null", "result":"true"}
null
. If so, true
is returned; otherwise, false
is returned.op_notnull(Value)
Parameter | Description | Type | Required | Default Value | Value Range |
data | Value of any type | any | Yes | - | - |
{}
fields_set("result", op_notnull("null"))
{"result":"false"}
{"data": null}
fields_set("result", op_notnull(v("data")))
{"data": "null", "result":"false"}
true
is returned.op_str_eq(Value 1, Value 2, ignore_upper=False)
Parameter | Description | Type | Required | Default Value | Value Range |
data1 | String value | string | Yes | - | - |
data2 | String value | string | Yes | - | - |
ignore_upper | Case sensitivity | bool | No | False | - |
{"field": "cls"}
fields_set("result", op_str_eq(v("field"), "cls"))
{"result":"true","field":"cls"}
{"field": "cls"}
fields_set("result", op_str_eq(v("field"), "etl|cls|data"))
{"result":"true","field":"cls"}
{"field": "CLS"}
fields_set("result", op_str_eq(v("field"), "cls", ignore_upper=True))
{"result":"true","field":"CLS"}
{"field": "CLS"}
fields_set("result", op_str_eq(v("field"), "etl|cls|data", ignore_upper=True))
{"result":"true","field":"CLS"}
random(Value 1, Value 2)
Parameter | Description | Type | Required | Default Value | Value Range |
data1 | Numeric value or string that can be converted to a numeric value | number | Yes | - | - |
data2 | Numeric value or string that can be converted to a numeric value | number | Yes | - | - |
{"field1": "1"}
log_keep(op_eq(random(1, 5), 3))
{"field1": "1"}
{"field1": "1"}
fields_set("field2", random(1, 5))
{"field1":"1", "field2":"4"}
Apakah halaman ini membantu?