Copy as Markdown[Open in ChatGPT](https://chatgpt.com/?q=Read%20https%3A%2F%2Fdocs-docusaurus.kinsta.page%2Fdataprime%2Flanguage-reference%2Fcommands-reference%2Fblock.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)[Open in Claude](https://claude.ai/new?q=Read%20https%3A%2F%2Fdocs-docusaurus.kinsta.page%2Fdataprime%2Flanguage-reference%2Fcommands-reference%2Fblock.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)

# `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" }
```
