# Filter

> Filter transform plugin

### Description[​](https://seatunnel.apache.org/docs/2.3.7/transform-v2/filter#description) <a href="#description" id="description"></a>

Filter the field.

### Options[​](https://seatunnel.apache.org/docs/2.3.7/transform-v2/filter#options) <a href="#options" id="options"></a>

| name            | type  | required | default value |
| --------------- | ----- | -------- | ------------- |
| include\_fields | array | no       |               |
| exclude\_fields | array | no       |               |

Notice, you must set one and only one of `include_fields` and `exclude_fields` properties

#### include\_fields \[array][​](https://seatunnel.apache.org/docs/2.3.7/transform-v2/filter#include_fields-array) <a href="#include_fields-array" id="include_fields-array"></a>

The list of fields that need to be kept. Fields not in the list will be deleted.

#### exclude\_fields \[array][​](https://seatunnel.apache.org/docs/2.3.7/transform-v2/filter#exclude_fields-array) <a href="#exclude_fields-array" id="exclude_fields-array"></a>

The list of fields that need to be deleted. Fields not in the list will be kept.

#### common options \[string][​](https://seatunnel.apache.org/docs/2.3.7/transform-v2/filter#common-options-string) <a href="#common-options-string" id="common-options-string"></a>

Transform plugin common parameters, please refer to [Transform Plugin](/data-integration-with-nexus/nexus-elements/transform/transform-common-options.md) for details

### Example[​](https://seatunnel.apache.org/docs/2.3.7/transform-v2/filter#example) <a href="#example" id="example"></a>

The data read from source is a table like this:

| name     | age | card |
| -------- | --- | ---- |
| Joy Ding | 20  | 123  |
| May Ding | 20  | 123  |
| Kin Dom  | 20  | 123  |
| Joy Dom  | 20  | 123  |

we want to keep the field named `name`, `card`, we can add a `Filter` Transform like below:

```
transform {
  Filter {
    source_table_name = "fake"
    result_table_name = "fake1"
    include_fields = [name, card]
  }
}
```

Or we can delete the field named `age` by adding a `Filter` Transform with `exclude_fields` field set like below:

```
transform {
  Filter {
    source_table_name = "fake"
    result_table_name = "fake1"
    exclude_fields = [age]
  }
}
```

It is useful when you want to delete a small number of fields from a large table with tons of fields.

Then the data in result table `fake1` will like this

| name     | card |
| -------- | ---- |
| Joy Ding | 123  |
| May Ding | 123  |
| Kin Dom  | 123  |
| Joy Dom  | 123  |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.selfuel.digital/data-integration-with-nexus/nexus-elements/transform/filter.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
