Skip to content

Condition fields reference#

The language used in Peakhour.IO supports various condition fields to evaluate requests and responses. These fields can be divided into several categories: Standard request fields, Standard response fields, GeoIP fields, User agent fields, Bot fields and Fingerprint ML fields.

Standard request fields#

Standard request fields provide information about the incoming request. These fields can be used to make decisions based on the request parameters.

field description
http.host Value of the Host header
http.referer Value of Referer request header.
http.request.headers map of lowercase header names to array of bytes
http.request.method Request method ("GET").
http.request.uri Full path with query ("/path?query=value").
http.request.uri.path Path only without query ("/path").
http.request.uri.query Query only without starting ? ("query=value").
http.request.version HTTP version ("HTTP/1.1").
http.user_agent Value of User-Agent request header.
ip.src IP address. ("127.0.0.1").
ssl Whether the request is over TLS

For example, the field http.user_agent can be used to check for user-agents with the word curl present.

http.user_agent contains "curl"

Standard response fields#

Standard response fields provide information about the outgoing response. These fields can be used to make decisions based on the response parameters.

field description
http.response.code HTTP response code as integer
http.response.headers map of lowercase header names to array of bytes

For example, the field http.response.code can be used to check if the response code is equal to a certain value:

http.response.code == 200

GeoIP fields#

GeoIP fields provide information about the geographical location of the request's origin. These fields can be used to make decisions based on the request's origin.

field description
ip.geoip.asnum int, AS number
ip.geoip.country country code

For example, the field ip.geoip.country can be used to check if the request originates from a specific country:

ip.geoip.country == "US"

User agent fields#

User agent fields provide information about the client making the request. These fields can be used to make decisions based on the client's user agent string.

field description
user_agent.bot boolean. True if parsed user agent is detected as bot
user_agent.bot.type none, other, google, yandex, bing, facebook, alexa, apple, pinterest, petal, yahoo, duckduckgo, stripe, letsencrypt, ahrefs, semrush
user_agent.mobile boolean
user_agent.software unknown, browser, app, site-monitor, search-bot, bot
user_agent.type unknown, browser, mobile, bot, search-bot, email

For example, the field user_agent.mobile can be used to check if the client is making the request from a mobile device:

user_agent.mobile

Bot fields#

Bot fields provide information about whether the client making the request is a bot. These fields can be used to make decisions based on the client's bot status.

field description
bot.verified boolean. True if bot is verified.
bot.verification_state unknown, verifying, error, unverified, verified

For example, the field bot.verified can be used to check if the client's bot is verified:

bot.verified

Fingerprint ML fields#

Fingerprint ML fields provide information about the client making the request based on machine learning models. These fields can be used to make decisions based on the client's fingerprint.

field description
fingerprint.ml map of class names (string) to score (0-100)

Origin Shield Fields#

Origin Shield Fields are used to identify and interact with origin shields that protect the origin servers from direct public traffic.

Field Description
backend.is_shield Boolean. True if runs on shield.

Peakhour Fields#

Peakhour Fields provide insights specific to the Peakhour platform, such as user session information.

Field Description
peakhour.request.session Bytes. Value of the request session, either extracted from client cookies or generated by RP.

Peakhour Server Fields#

Peakhour Server Fields deliver details regarding the server configurations and locations within the Peakhour system.

Field Description
peakhour.server.name Bytes. The POP server name that handled the request