strings.hasPrefix() indicates if a string begins with a specified prefix.
Function type signature
(prefix: string, v: string) => bool
(Required) String value to search.
(Required) Prefix to search for.
Filter based on the presence of a prefix in a column value
import "sampledata" import "strings" sampledata.string() |> filter(fn: (r) => strings.hasPrefix(v: r._value, prefix: "smpl_5"))
Was this page helpful?
Thank you for your feedback!
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, use the following resources:
Customers with an annual or support contract can contact InfluxData Support.