API operation · security group
POST
/security/jails/{name}/test
First published 3 Oct 2026
0.1.0Unchanged since publicationTest a ban rule's filter against a log
Who may call it
AdministratorResellerCustomer
Token scope, any of
securityallAnswers200 OK
UrbeStack runs fail2ban-regex with the rule's filter against up to 1,000 of the most recent lines from its configured log file or systemd journal. Supply log to use a different file. The response reports the total, matched and missed line counts and includes up to three matching lines.
The test has a 330-second timeout. UrbeStack returns 400 if name or log is invalid or if name is one of the reserved names default and includes.
As a command
Run as root on the serverParameters
namepath ·string, matching ^[a-z0-9][a-z0-9-]{0,31}$RequiredRequest body
JSON· 1 fieldlogstring, up to 255 charactersAbsolute path to an alternate log file. Use letters, digits, dots, dashes and underscores within path components, with no parent-directory (..) components.
Example
See the API overview for how to set $API and $TOKEN.Request
curl -sS -X POST "$API/security/jails/alice/test" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"log": ""
}'Response ·
200 OK{
"examples": [
"text"
],
"filter": "text",
"lines": 1,
"log": "",
"matched": 1,
"missed": 1
}Errors
15 errors, each a status and a sentence400'<n>' is a name fail2ban keeps for itself400<what> is a number of seconds, or with a unit: 10m, 1h, 2d, 1w400<what> must be between 400A log is an absolute path of letters, digits, dots, dashes and underscores400A log path may not contain ..400A pattern is 1 to 500 printable characters on one line400A pattern needs <HOST> where the address is400A rule name is 1 to 32 lowercase letters, digits and dashes400A scope is all, mail or web400Give a rule name, or a log and a pattern400The pattern is not a regular expression: 400Tries must be a number from 1 to 1000400fail2ban-regex could not run the test: <why>401Authentication required404<source> does not existNo error of this operation matches.
Generated from release 0.2.35 (current) · the API’s own descriptionThis entry has been unchanged since it was first published in release 0.1.0 on 3 Oct 2026.
urbestack.com/docs/api/post-security-jails-name-test/