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



The string value to search.

Data type: String


The suffix to search for.

Data type: String

Filter based on the presence of a suffix in a column value
import "strings"

  |> filter(fn:(r) => strings.hasSuffix(v: r.metric, suffix: "_count" ))

New! Cloud or OSS?

InfluxDB OSS 2.0 now generally available!

InfluxDB OSS 2.0 is now generally available and ready for production use. See the InfluxDB OSS 2.0 release notes.

For information about upgrading to InfluxDB OSS 2.0, see: