toUInt() function

The toUInt() function converts a value to an UInteger.

Function type: Type conversion


Supported data types: Boolean | Duration | Float | Integer | Numeric String | Time

For duration and time values, toUint() returns the following:

Input type Returned value
Duration The number of nanoseconds in the specified duration
Time A nanosecond epoch timestamp

To convert values in a column other than _value, define a custom function patterned after the function definition, but replace _value with your desired column.


from(bucket: "telegraf")
  |> filter(fn:(r) =>
    r._measurement == "mem" and
    r._field == "used"
  |> toUInt()

Function definition

toUInt = (tables=<-) =>
    |> map(fn:(r) => ({ r with _value: uint(v:r._value) }))

This documentation is open source. See a typo? Please, open an issue.

Need help getting up and running? Get Support