Block
The Block rule filters logs using conditions across the body, standard log metadata, and parsed attributes. Blocked logs are dropped entirely and never indexed—reducing storage costs and noise.
When to Use
- You have high-volume, low-value logs consuming storage (health checks, keep-alive pings, verbose debug output).
- A specific workload generates logs you never query.
- You want to combine conditions across fields, such as workload, severity, body text, and parsed attributes.
- You want to keep only logs matching a condition (for example, errors only) from a noisy source.
Fields
| Field | Required | Description |
|---|---|---|
| Name | Yes | Rule identifier |
| Block condition | No | Condition evaluated for each log. It can combine body, metadata, and parsed attributes. An empty condition matches every log. |
| Block Logic | Yes | See below |
Block Logic Options
| Option | Behavior |
|---|---|
| Block all matching | Drops logs where the condition is true. Logs that don't match pass through. |
| Block all non-matching | Drops logs where the condition is false. Only matching logs pass through. |
How It Works
For each incoming log, the rule evaluates its condition and applies the selected Block Logic. Conditions can use AND, OR, NOT, and parentheses to combine multiple fields.
| Operators | Purpose |
|---|---|
=, != | Exact equality or inequality |
>, <, >=, <= | Numeric comparisons |
LIKE, ILIKE | Case-sensitive or case-insensitive substring matching |
MATCH | Match a Vector-compatible regular expression |
Use regular field names such as workload, namespace, level, or body. Prefix parsed attributes with @, for example @http.status_code. KubeSense validates the condition against Vector before the pipeline can be saved.

Blocked logs are discarded before indexing — they will not appear in searches, dashboards, or alerts.
warning: With Block all matching, an empty condition blocks every log selected by the pipeline's Rule Matcher. Test the condition in the playground before saving.
Examples
Block Health Check Logs
- Block condition:
body MATCH 'GET /(healthz|readyz|livez)' - Block Logic: Block all matching
Result: All Kubernetes health check probe logs are dropped.
Block Debug-Level Logs
- Block condition:
level = "DEBUG" OR level = "TRACE" - Block Logic: Block all matching
Result: Only INFO, WARN, ERROR, and CRITICAL logs are indexed.
Keep Only Error Logs
- Block condition:
level = "ERROR" OR level = "CRITICAL" OR level = "FATAL" - Block Logic: Block all non-matching
Result: Only error-level logs from the matched workloads are indexed. All other severity levels are dropped.
Combine Metadata and Attributes
- Block condition:
workload MATCH '^log-printer-.*$' AND @route = "/health" - Block Logic: Block all matching
Result: Health-route logs are dropped only for workloads whose names start with log-printer-.
Existing Regex Rules
Existing Block rules created with Source Field and Regular Expression continue to work. Open one and choose Convert to advanced conditions to move it to the condition editor. Conversion preserves the original Block Logic and validates the generated condition before changing the form.
Tips
- Block rules permanently discard logs. Be specific with your regex and Rule Matcher to avoid accidentally dropping logs you need.
- Use Block all non-matching carefully — it drops everything that doesn't match, which can be aggressive.
- Test the condition with a representative JSON event in the playground before saving.
- Combine Block with a specific Rule Matcher to target only certain workloads, keeping logs from other sources untouched.
- Place Block after any transformations it depends on. If the pipeline uses Protect, Block must come before the final Protect rule.