User agent does not match

Matches when the User-Agent request header does not match any specified regular expressions.

This condition inspects the User-Agent header of the incoming request to determine if it does not match a regular expression. It returns true if the header value does not satisfy any of the defined patterns.

Configuration

  • Case sensitive: Whether to enable case sensitivity during the comparison. When disabled, the condition performs a case-insensitive match against the User-Agent string.
  • Enter your pattern(s): The RE2 regular expression used to evaluate the User-Agent string. Entries should be separated by a new line.
  • Defined patterns: The list of all active patterns for this condition. The condition returns true only if the User-Agent header fails to match every pattern in this list.

Measurement

The condition extracts the User-Agent header from the incoming request and evaluates it against the Defined patterns.

  • Match found: If the header value matches any regular expression in the list, the condition returns false.
  • No match found: If the header value matches none of the patterns, the condition returns true.
  • Missing header: If the User-Agent header is absent from the request, the condition returns true.

Performance

  • Sequential validation: To return true, the system must evaluate the entire list of patterns to ensure no matches exist. Large lists add an incremental processing cost to every request that passes through the filter.
  • Short-circuit optimization: The system stops processing and returns false as soon as it identifies a match. To optimize performance for traffic that should be excluded, place the patterns most likely to match at the top of the list.

Last modified March 5, 2026