Logsflags: g
Log Level
Matches standard log level keywords in log lines.
Try it in RegexPro →Available in
Pattern
regexengine-agnostic
\b(TRACE|DEBUG|INFO|WARN|ERROR|FATAL)\b (flags: g)Raw source: \b(TRACE|DEBUG|INFO|WARN|ERROR|FATAL)\b
How it works
`\b(TRACE|DEBUG|INFO|WARN|ERROR|FATAL)\b` matches any of the six standard log levels as whole words.
Examples
Input
[INFO] Server started. [ERROR] Connection failed.Matches
INFOERROR
Input
DEBUG: cache missMatches
DEBUG
Common use cases
- •Log filtering
- •Alerting
- •Error triage
Related patterns
Nginx Error Log
LogsParses Nginx error log lines.
Apache Common Log Format
LogsParses Apache Common Log Format entries.
CloudWatch Log Stream Path
LogsMatch AWS CloudWatch log group / stream paths like `/aws/lambda/my-function` or `/aws/ecs/cluster-name`.
JSON Log Line (Single-Line Object)
LogsMatch a single-line JSON object — typical of structured logging from services like slog, Bunyan, or Pino.
Related concepts
Alternation with the | Operator
ConceptThe pipe | matches either the expression on its left or on its right. Combine with groups to alternate over a subpattern.
How to Match Multiple Patterns (Alternation)
How-toCombine patterns with | to match either option. Wrap alternatives in a group to scope the alternation correctly.