Skip to content

Functions

Functions#

The wirefilter language supports functions to aid in defining complex criteria in filtering requests and responses.

any#

Returns true when the comparison operator in the argument returns true for any values in argument array.

any(http.request.headers["block-me"][*] == "true")

concat#

The concat() function concatenates all the argument values into a single string.

ends_with#

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

For example, to match only requests with URLs ending in ".html", the following filter can be used:

ends_with(http.request.uri, ".html")

lower#

The lower() function converts the string argument to lowercase.

starts_with#

The starts_with() function returns true if the first argument (field name or bytes) starts with the second argument (literal bytes).

For example, to match only requests with URLs starting with "/da", the following filter can be used:

starts_with(http.request.uri.path, "/da")