strings.hasSuffix() function
The strings.hasSuffix()
function indicates if a string ends with a specified suffix.
Output data type: Boolean
import "strings"
strings.hasSuffix(v: "go gopher", suffix: "go")
// returns false
Parameters
v
The string value to search.
suffix
The suffix to search for.
Filter based on the presence of a suffix in a column value
import "strings"
data
|> filter(fn:(r) => strings.hasSuffix(v: r.metric, suffix: "_count" ))
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for Flux and this documentation. To find support, the following resources are available:
InfluxDB Cloud customers can contact InfluxData Support.