toString() function
The toString()
function converts all values in the _value
column to strings.
*Function type: Type conversion*
toString()
*Supported data types: Boolean | Bytes | Duration | Float | Integer | Time | Uinteger*
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.
Examples
from(bucket: "telegraf")
|> filter(fn:(r) =>
r._measurement == "mem" and
r._field == "used"
)
|> toString()
Function definition
toString = (tables=<-) =>
tables
|> map(fn:(r) => ({ r with _value: string(v: r._value) }))
*Used functions: map(), string()*