strings.hasPrefix() function
The strings.hasPrefix()
function indicates if a string begins with a specified prefix.
Output data type: Boolean
import "strings"
strings.hasPrefix(v: "go gopher", prefix: "go")
// returns true
Parameters
v
The string value to search.
prefix
The prefix to search for.
Filter based on the presence of a prefix in a column value
import "strings"
data
|> filter(fn:(r) => strings.hasPrefix(v: r.metric, prefix: "int_" ))
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.