Update kapacitor conditional function example, closes influxdata/DAR#162

pull/2065/head
Scott Anderson 2021-01-14 13:12:18 -07:00
parent e6eceb5759
commit 1f298b66b9
1 changed files with 3 additions and 3 deletions

View File

@ -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)
```