# urbestack-jail-test

First published 3 Oct 2026 (release 0.1.0) · Unchanged since publication

UrbeStack release 0.2.35 command, run as root in the server shell.

## Usage

```
urbestack-jail-test --name NAME [--log PATH]
urbestack-jail-test --log PATH --pattern 'REGEX with <HOST>'
```

## Description

Tests a ban rule or a regular expression against up to 1,000 of the most recent lines from a log file or systemd journal. It reports the total, matched and missed line counts and includes up to three matching lines.

Use --name to test a rule's filter or pattern against its configured log file or journal. Use --log to test against a different file by giving its absolute path.

Use --pattern to supply your own single-line regular expression of up to 500 characters, with <HOST> where the IP address appears. When you supply --pattern, also give --log unless --name selects a rule with a log file.

## Same in the API

- [POST /security/jails/test](https://urbestack.com/docs/api/post-security-jails-test.md): Test an unsaved ban rule pattern against a log file
- [POST /security/jails/{name}/test](https://urbestack.com/docs/api/post-security-jails-name-test.md): Test a ban rule's filter against a log

## Command family: jail

- [urbestack-jail-add](https://urbestack.com/docs/commands/urbestack-jail-add.md): Adds a custom ban rule.
- [urbestack-jail-del](https://urbestack.com/docs/commands/urbestack-jail-del.md): Removes a custom ban rule.
- [urbestack-jail-list](https://urbestack.com/docs/commands/urbestack-jail-list.md): Lists the ban rules shipped with UrbeStack, followed by custom rules in name order.
- [urbestack-jail-set](https://urbestack.com/docs/commands/urbestack-jail-set.md): Updates an existing ban rule.
