---
title: block
description: |
  The `block` command filters out all documents where the given predicate
  evaluates to true. It is the inverse of `filter`, which keeps only documents
  that match the predicate.
url: https://coralogix.com/docs/dataprime/language-reference/commands-reference/block/
product: dataengine
feature: DataPrime Language
feature_id: dataprime-language
feature_identifier: dataengine/dataprime-language
last_updated: '2026-10-21'
---

# `block`

## Description

The `block` command filters out all documents where the given predicate evaluates to true. It is the inverse of `filter`, which keeps only documents that match the predicate.

## Syntax

```
block <boolean expression>
```

## Example

**Use case: Exclude successful HTTP responses**

In this example, we remove all documents representing successful (2xx) HTTP status codes to focus on redirects and errors.

### Example data

```
{ "status_code": "200", "endpoint": "/api/login" },

{ "status_code": "301", "endpoint": "/api/redirect" },

{ "status_code": "500", "endpoint": "/api/payment" }
```

### Example query

```
block $d.status_code.startsWith('2')
```

### Example output

```
  { "status_code": "301", "endpoint": "/api/redirect" },

  { "status_code": "500", "endpoint": "/api/payment" }
```
