Merge pull request #2065 from influxdata/kapacitor-update-conditional

Update Kapacitor conditional function example
pull/2072/head
Tara Planas 2021-01-14 12:19:39 -08:00 committed by GitHub
commit 13a154aab4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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)
```