docs-v2/content/v2.0/reference/flux/functions/strings/hassuffix.md

794 B

title description menu weight related
strings.hasSuffix() function The strings.hasSuffix() function indicates if a string ends with a specified suffix.
v2_0_ref
name parent
strings.hasSuffix Strings
301
/v2.0/reference/flux/functions/strings/hasprefix

The strings.hasSuffix() function indicates if a string ends with a specified suffix.

Output data type: Boolean

import "strings"

strings.hasSuffix(v: "go gopher", t: "go")

// returns false

Parameters

v

The string value to search.

Data type: String

t

The suffix to search for.

Data type: String

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

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