Description
Return priority, floor(priority/8) facility, and priority modulo eight severity.
Protocol fields often encode several values in a small token. Checking its supported grammar or extracting a component is narrower than validating a complete message or the behavior of its sender.
Return priority, floor(priority/8) facility, and priority modulo eight severity.
When to use this tool
Use Syslog Prival Single Field when you need to inspect or format the supported protocol field in isolation.
How to use the tool and how it works
- Enter priorityToken. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read priority, facility, severity. Use the output convention below.
Require a canonical angle-bracketed integer priority token with no leading zeros except zero and a value 0-191. Return priority, floor(priority/8) facility, and priority modulo eight severity.1
Syslog combines a facility and severity into PRI as facility × 8 + severity, with PRI from 0 through 191. Parsing this field alone does not validate the remaining syslog message.2
| Input field | Meaning and units | Accepted input |
|---|---|---|
| priorityToken | Entire canonical angle-bracket PRI field, with decimal priority from 0 through 191. | Required. Text; maximum UTF-16 length 8192. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| priority | Priority | Required. Safe integer. |
| facility | Integer facility from floor(priority / 8). | Required. Safe integer. |
| severity | Integer severity from priority modulo 8. | Required. Safe integer. |
{
"input": {
"priorityToken": "<165>"
},
"output": {
"priority": 165,
"facility": 20,
"severity": 5
}
} Limitations and assumptions
- This parses only PRI, not a complete syslog message, transport, timestamp, sender identity, or actual event severity.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
Alternative or Complementary methods
Validate the complete message and its context with the relevant protocol implementation when interoperability matters.
References
-
Calculation and input contract: parse/syslog-prival-single-field — tool.io
-
The Syslog Protocol, RFC 5424: PRI — RFC Editor / IETF
Similar or alternative tools
- log/syslog-priority-token-parser
Parse or format one complete RFC 5424 syslog priority token in the 0–191 range; no full message parsing.
- log/syslog-priority-component-split
Split a validated syslog priority integer into facility and severity bit-field values.