API operation · security group
POST
/security/jails/test
First published 3 Oct 2026
0.1.0Unchanged since publicationTest an unsaved ban rule pattern against a log file
Who may call it
AdministratorResellerCustomer
Token scope, any of
securityallAnswers200 OK
Supply the absolute log file path in log and a single-line regular expression of 1 to 500 printable ASCII characters in pattern, with <HOST> where the IP address appears. Path components can contain letters, digits, dots, hyphens, and underscores. The API returns 400 for an invalid path, including a .. component, or an invalid pattern.
UrbeStack runs fail2ban-regex on up to 1,000 of the most recent lines. The response includes the total, matched, and missed line counts and up to three matching lines. The test has a timeout of 330 seconds.
As a command
Run as root on the serverlogstring, up to 255 charactersRequiredpatternstring, up to 500 charactersRequiredExample
See the API overview for how to set $API and $TOKEN.Request
curl -sS -X POST "$API/security/jails/test" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"log": "",
"pattern": "text"
}'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-test/