Update kapacitor conditional function example, closes influxdata/DAR#162
parent
e6eceb5759
commit
1f298b66b9
|
@ -355,15 +355,15 @@ The second and third arguments must return the same type.
|
|||
Example:
|
||||
|
||||
```js
|
||||
|eval(lambda: if("field" > threshold AND "field" != 0, 'true', 'false'))
|
||||
|eval(lambda: if("field" > threshold AND "field" != 0, 'high', 'normal'))
|
||||
.as('value')
|
||||
```
|
||||
|
||||
The value of the field `value` in the above example will be the string `true` or `false`, depending on the condition passed as the first argument.
|
||||
The value of the field `value` in the above example will be the string `high` or `normal`,
|
||||
depending on the condition passed as the first argument.
|
||||
|
||||
The `if` function's return type is the same type as its second and third arguments.
|
||||
|
||||
|
||||
```js
|
||||
if(condition, true expression, false expression)
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue