run_logtest
Test any log line against OSSEC rules and decoders to see decoding, rule matches, and alert level.
Instructions
Test a log line against OSSEC rules and decoders.
Runs a log line through OSSEC's analysis engine to see how it would be decoded, which rules it matches, and what alert level it would generate. Extremely useful for debugging rules and decoders.
Args: log_line: The log line to test (e.g., a syslog line, auth.log entry, etc.). verbose: If True, include verbose rule matching details.
Returns: JSON object with decoding results, matched rules, and alert info.
Example log lines to test: - 'Mar 12 10:00:00 server sshd[1234]: Failed password for root from 10.0.0.1 port 22' - 'Mar 12 10:00:00 server sudo: user1 : TTY=pts/0 ; PWD=/home ; COMMAND=/bin/su -'
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| log_line | Yes | ||
| verbose | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |