Skip to content

ends_with

The ends_with() function checks if a given value ends with a specified suffix.

Syntax

ends_with(value, suffix)

Parameters

  • value: The value to check (field name, bytes).
  • suffix: The suffix to match against (literal bytes).

Return Value

Returns a boolean value: true if the value ends with the specified suffix, false otherwise.

Example

ends_with(http.request.uri.path, ".html") // Checks if the URI path ends with ".html"

Use Cases

  • Filtering requests based on file extensions.
  • Identifying specific types of resources.
  • Implementing content-type based routing.