Documentation
¶
Overview ¶
Package logfilter provides a simple query syntax for filtering logs. The syntax supports:
- Word matching: `error` matches logs containing "error" (case-insensitive)
- Quoted phrases: `"error message"` or `'error message'` matches exact phrase (case-insensitive)
- Regex matching: `/pattern/` matches logs matching the regex pattern
- Negation: `-word` excludes logs containing "word"
- Multiple terms: `error timeout` requires both terms to match (AND)
Examples:
- `error` - logs containing "error"
- `"connection failed"` - logs containing exact phrase "connection failed"
- `error timeout` - logs containing both "error" AND "timeout"
- `-debug` - logs NOT containing "debug"
- `error -debug` - logs containing "error" but NOT "debug"
- `/err(or)?/` - logs matching the regex
- `error /warn(ing)?/` - logs containing "error" AND matching the regex
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Filter ¶
type Filter struct {
// contains filtered or unexported fields
}
Filter represents a compiled log filter that can match log lines and be converted to LogsQL for server-side filtering.
func (*Filter) Match ¶
Match returns true if the line matches the filter. All terms must match (AND logic), with negated terms inverted.
Click to show internal directories.
Click to hide internal directories.