HTTP transaction (http_transaction)
Runs a sequence of HTTP requests as one test and reports how long each step and the whole run took, and which step failed. Cookies are kept from one step to the next, a value taken from one answer (a token, an authorisation code, a hidden form field) can be used in a later request, and a form on a page can be sent back with the account of the device's login credential. Use it to check that a user can actually sign in and get something back, not only that a page answers. It sits beside http_content, which checks one request.
What it looks like

The sensor's page after a few polls, signing in to a test identity server through the authorisation code flow described below. In the dark theme: the sensor's page. The form for adding it, with its parameters filled in: light, dark.
Channels
| Key | Name | Unit | Default limits |
|---|---|---|---|
total_ms | Total time | ms | warning above 5000, error above 20000 |
failed_step | Failed step | none | 0 when every step passed, else the number of the step that failed; its value labels carry the step names |
step_1_ms, step_2_ms, ... | <step name> time | ms | none; set limits on a step's channel like on any other |
There is one step_N_ms channel for each step, named after the step. A step that was not run because an earlier one failed has no value for that poll. The time of a step is the time the server took to answer, added up over the requests of the step when it follows redirects; it does not include the sensor's own work between steps.
Parameters
| Parameter | Default | Meaning |
|---|---|---|
scheme | https | http or https. |
port | 80 or 443 | TCP port of the device. Every step goes to the device the sensor is on, on this port; a step cannot name another port or host. |
verify_tls | true | Check the server certificate. |
tls_fingerprint | none | Trust exactly the certificate with this SHA-256 fingerprint, for every request of the run. See pinning a certificate. |
max_body_bytes | 1048576 | How much of each answer is read and searched, 1024 to 10485760. |
steps | required | The requests, 1 to 20, in order. The run stops at the first step that fails. |
A step has these fields:
| Field | Default | Meaning |
|---|---|---|
name | step N | Shown in messages and as the step's channel name, at most 60 characters. |
path | none | Path and query on the device, starting with /, with no // at the start and no backslash. Exactly one of path and submit_form is needed. |
submit_form | none | Send a form of the page the previous step returned instead: see below. Not allowed in the first step. |
method | GET | GET, HEAD, POST, PUT, PATCH or DELETE. A submitted form uses the form's own method. |
headers | none | Extra request headers, at most 16. Cookie, Host and Content-Type are set by Probeward. A header whose name looks like a credential (Authorization, anything with token, secret or password) must take its value from a variable, as in Bearer {{token}}. |
bearer | none | Send Authorization: Bearer with the value of this variable, set by an earlier step. |
basic_auth | false | Send Authorization: Basic with the login credential. |
form | none | Fields sent as application/x-www-form-urlencoded with POST, PUT or PATCH, as {"name": ..., "value": ...}. |
json_body | none | A JSON body for POST, PUT or PATCH, at most 64 KiB. Give form or json_body, not both. |
expected_status | ["200-299"] | Codes that count as healthy: 204, 2xx or 200-299. |
max_redirects | 5 | Redirects to follow, 0 to 10, and only to the same host. Use 0 to read the Location of a redirect. |
extract | none | Values to keep for later steps, at most 10: see below. |
must_contain, must_not_contain, must_match, must_not_match | none | Content checks on the answer's body, as for http_content. |
Values: {{name}}
A variable is written {{name}} (lower case letters, digits and _, starting with a letter) in a step's path, header values, form, json_body and submit_form fields. It is replaced by the value an earlier step extracted. In a path it is encoded for a URL, so a value with & or a space cannot change the request; {{name|raw}} inserts it as it is, for a value that is itself a path. In a json_body it is escaped for the inside of a JSON string. A variable used before any step sets it is refused when the parameters are saved, and a variable that an optional extraction left unset fails the step that uses it, by name.
Each entry of extract has name, from, key, and optionally group and required:
from | key is | Takes |
|---|---|---|
header | a header name | The first value of that response header. |
location_query | a parameter name | That parameter from the query (or, failing that, the fragment) of the Location header, such as the code of an authorisation redirect. Combine with max_redirects: 0. |
json | a JSON Pointer or a simple path | A string, number or boolean in a JSON body, as for rest_json. |
body_regex | a regular expression | The capture group group (default 1; 0 is the whole match) of the first match in the body. |
html_input | an input name | The value of the first input of that name in an HTML page, or the content of a meta tag of that name: a forgery token. |
With required: false a missing value leaves the variable unset instead of failing the step. A value longer than 8192 bytes fails the step. username and password are the credential's and cannot be extracted.
Submitting a form
submit_form finds a form in the page the previous step returned and sends it as a browser would: to the form's address, with its method, and with the fields it holds (hidden fields, text and password inputs, checked boxes, text areas and the selected option of a menu; buttons are not sent). Its fields are set on top, by name, or added. form names the form by its id or name; without it the first form with a password field is used, or else the first form. A form whose address is on another host is not sent. The page must have been read whole: raise max_body_bytes if a form is near the end of a large page.
Signing in
The steps may use the login credential: {{username}} and {{password}} in a form field, a form-encoded body or a JSON body, and basic_auth. Create a credential of kind login and assign it to the sensor, its device or a group above it. The password is never a parameter, and it cannot be put in a path or a header. It is sent only to the device, never written to a message, a log, an event or a payload, and a refused sign-in says only that the account or its password may have been refused. Without a login credential assigned, a step that needs one fails with a message that says so, before anything is sent.
An authorisation code flow
This is what the test identity server in the pictures is checked with: fetch the authorisation page, post its login form, take the code from the redirect, exchange it for a token and read the user's record with it.
{
"scheme": "http",
"port": 8080,
"steps": [
{"name": "Authorisation page",
"path": "/realms/example/protocol/openid-connect/auth?client_id=web-app&response_type=code&scope=openid&redirect_uri=http%3A%2F%2Flocalhost%2Fcb",
"must_contain": "kc-form-login"},
{"name": "Sign in",
"submit_form": {"fields": [
{"name": "username", "value": "{{username}}"},
{"name": "password", "value": "{{password}}"}]},
"expected_status": ["302"], "max_redirects": 0,
"must_not_contain": "Invalid username or password",
"extract": [{"name": "code", "from": "location_query", "key": "code"}]},
{"name": "Exchange the code", "method": "POST",
"path": "/realms/example/protocol/openid-connect/token",
"form": [{"name": "grant_type", "value": "authorization_code"},
{"name": "client_id", "value": "web-app"},
{"name": "code", "value": "{{code}}"},
{"name": "redirect_uri", "value": "http://localhost/cb"}],
"extract": [{"name": "access_token", "from": "json", "key": "access_token"}]},
{"name": "User info", "path": "/realms/example/protocol/openid-connect/userinfo",
"bearer": "access_token", "must_contain": "preferred_username"}
]
}The redirect address is not fetched: it points to another host, so the second step stops at the redirect and reads the code from it. A wrong password makes the identity server show its login page again with status 200; step 2 then fails with HTTP 200 is not in the expected set [302] and the hint about the account, and the forbidden text in must_not_contain says why when the page gives a reason.
Who can attach it
Only administrators can create an http_transaction sensor or change its parameters, as with the sensors that run programs and send queries of their own. An operator can still rename it, pause it and set its limits. A device template cannot attach one, so discovery never proposes it. The reason is that a step can send writes (POST, PUT, DELETE) as the account of the login credential, and the person who attaches the sensor need not be allowed to see that credential. Use a dedicated account that can do no more than the test needs.
Cookies, redirects and other hosts
Cookies the server sets are kept for the run and sent back to the host and path they belong to, with Secure cookies only over HTTPS; an expired or deleted cookie is dropped. The jar starts empty on every poll and is never stored. It does not know the public suffix list. Redirects are followed only to the same host (any port of it); a redirect to another host is not followed, the answer is judged as it is, and the message names the other host (never the path or query, which may carry a code). The device's credential, the cookies and the pin are never sent anywhere else.
Suggested interval: 300 seconds. Credential: an optional login credential, needed by the steps that use it.
On the target
A web application reachable from the probe host. For a test of a sign-in, an account that only needs to sign in. Take care that a sensor which signs in every few minutes does not trip the application's own lockout or alerting: use a dedicated account.
Failures
| Message | Meaning |
|---|---|
step N (name) failed: HTTP S is not in the expected set [...] | Down. The step is named in the message and in failed_step. When the step used the password, the message adds that the account or its password may have been refused. |
... it redirects to <origin>, another host, which is not followed | Down. The answer redirected away from the device. |
... the body does not contain ... and the other content messages | Down. As for http_content. |
... cannot set <name>: no <key> parameter in the Location header (or no header, no match, no text or number at the path, no input) | Down. A value a later step needs was not in the answer. |
step N: ... has no value: no earlier step set it (kind config) | An optional value was not set and a step needs it. |
step N: this sensor needs a login credential ... (kind config) | A step uses {{username}}, {{password}} or basic_auth and no login credential is assigned or inherited. |
step N: the previous page has no form to submit, ... no form <name> (kind protocol) | The page was not the page expected. |
step N: the form posts to another host (...); nothing was sent (kind protocol) | The form's address is not on the device. |
step N (name): cannot connect: ... (kind unreachable), no answer within N ms (kind timeout), TLS error: ... (kind protocol) | As for http_status, with the step named. The poll has no channels. |
Verification
Checked against a real Keycloak identity server and a real go-httpbin in a lab, and with scripted web servers for the cases a lab cannot make. Live, over HTTP to the identity server, it signs in through the authorisation code flow (page, form, code, token, user record), and with a wrong password stops at step 2 with the account message and no later channel. Against the test service it carries a cookie set by a redirect through five requests, carries a value from one answer into the next request's bearer token, and names the failing step for a status and for a closed port. The scripted tests cover the form reader (hidden fields, checkboxes, menus, text areas, broken markup), cookie domains, paths, Secure and deletion, the same-host rule for redirects and forms, the encoding of values in paths and JSON bodies, and that no password, code or token reaches a message. Not seen: an application that signs in with JavaScript, with a one-time code or a captcha, a login form that is built by a script, multipart bodies, HTTP/2-only servers, and a server that needs a client certificate.
The live tests are crates/probeward-sensors/tests/web_flow_live.rs; they read PROBEWARD_TEST_WEB_HOST, PROBEWARD_TEST_WEB_USER, PROBEWARD_TEST_WEB_PASSWORD, PROBEWARD_TEST_WEB_REALM, PROBEWARD_TEST_WEB_CLIENT and the optional PROBEWARD_TEST_WEB_KEYCLOAK_PORT and PROBEWARD_TEST_WEB_HTTPBIN_PORT, and skip when they are not set. The scripted tests are in crates/probeward-sensors/tests/sensors_http_flow.rs.