Value Functions

Overview

value

value(string m) number

Retrieves the value for the specified metric m received in the same series command or parsed from the same row in the CSV file.

Example:

value > 1.5 && value('temperature') > 50
series e:sensor01 m:pressure=3.5 m:temperature=80

Assuming the rule is created for the pressure metric, the above condition resolves fields and evaluates to true.

3.5 > 1.5 && 80 > 50
// returns true

If the value of the pressure metric is less than 50 the condition evaluates to false.

series e:sensor01 m:pressure=3.5 m:temperature=33
3.5 > 1.5 && 33 > 50
// returns false

Compared to the db_last function, the value() function retrieves metric values from the incoming command, even if they are not yet stored in the database.