Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
b7752ea
Update delete_entries processor to add new features
kennedy-onyia Oct 15, 2025
66e3c60
update select_entries processor documentation to account for new incl…
kennedy-onyia Oct 31, 2025
26449fa
fix style check errors and include additional pipeline configurations…
kennedy-onyia Nov 4, 2025
e782c48
Merge branch 'main' into select-entries-update
kennedy-onyia Nov 4, 2025
db8e06f
Update _data-prepper/pipelines/configuration/processors/delete-entrie…
kennedy-onyia Nov 6, 2025
9f01559
Update _data-prepper/pipelines/configuration/processors/select-entrie…
kennedy-onyia Nov 6, 2025
912882a
Update _data-prepper/pipelines/configuration/processors/delete-entrie…
kennedy-onyia Nov 6, 2025
80acded
Update _data-prepper/pipelines/configuration/processors/select-entrie…
kennedy-onyia Nov 6, 2025
a84322a
Update _data-prepper/pipelines/configuration/processors/select-entrie…
kennedy-onyia Nov 6, 2025
9db89bc
Update _data-prepper/pipelines/configuration/processors/delete-entrie…
kennedy-onyia Nov 6, 2025
b8dba47
Update _data-prepper/pipelines/configuration/processors/select-entrie…
kennedy-onyia Nov 6, 2025
2953e17
Update _data-prepper/pipelines/configuration/processors/select-entrie…
kennedy-onyia Nov 6, 2025
3ce0d90
Merge branch 'main' into select-entries-update
kennedy-onyia Nov 6, 2025
8f8148e
Merge branch 'main' into select-entries-update
kennedy-onyia Nov 6, 2025
39ca895
Update _data-prepper/pipelines/configuration/processors/delete-entrie…
kennedy-onyia Nov 6, 2025
fea0696
Update _data-prepper/pipelines/configuration/processors/delete-entrie…
kennedy-onyia Nov 6, 2025
b480fb5
Merge branch 'main' into select-entries-update
kennedy-onyia Nov 10, 2025
3d1252f
Update _data-prepper/pipelines/configuration/processors/delete-entrie…
kolchfa-aws Nov 10, 2025
faea6c1
Update _data-prepper/pipelines/configuration/processors/delete-entrie…
kolchfa-aws Nov 10, 2025
e495ab0
Update _data-prepper/pipelines/configuration/processors/delete-entrie…
kolchfa-aws Nov 10, 2025
676b41b
Apply suggestions from code review
natebower Nov 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@

# Delete entries processor

The `delete_entries` processor deletes entries, such as key-value pairs, from an event. You can define the keys you want to delete in the `with-keys` field following `delete_entries` in the YAML configuration file. Those keys and their values are deleted.
The `delete_entries` processor removes entries, such as key-value pairs, from an event. Use the `with_keys` field to specify
the exact keys to delete. To delete keys that match a regular expression pattern, use the `with_keys_regex` field. You can
prevent deletion of specific events when using regular expressions by configuring the `exclude_from_regex` field.

To use both `with_keys` and `with_keys_regex` in the same configuration, define them under the `entries` field.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a little confusing. Do you mean to say that the pipeline author would need to create two different entries?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol yes. i'll modify the grammar to make it more clear


## Configuration

Expand All @@ -21,9 +25,15 @@
- source: https://github.com/opensearch-project/data-prepper/blob/c4455a7785bc2da4358067c217be7085e0bc8d0f/data-prepper-plugins/mutate-event-processors/src/main/java/org/opensearch/dataprepper/plugins/processor/mutateevent/DeleteEntryProcessorConfig.java
-->

| Option | Required | Description |
:--- | :--- | :---
| `with_keys` | Yes | An array of keys for the entries to be deleted. |
| Option | Required | Description |
:--- |:---------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| `with_keys` | No | An array that specifies the keys of the entries to delete. |
| `with_keys_regex` | No | An array of regular expression (regex) patterns used to match the keys of entries to delete. |
| `exclude_from_delete` | No | A set of entries to exclude from deletion when using the `with_keys_regex` configuration. |
| `entries` | No | A list of entries to delete from the event. |
| `delete_when` | No | Specifies under what conditions the deletion should be perfomed. (Example: <i>value= "/some_key == null"</i> - Deletion runs only if <i>some_key</i> is null or does not exist.) |

Check failure on line 34 in _data-prepper/pipelines/configuration/processors/delete-entries.md

View workflow job for this annotation

GitHub Actions / style-job

[vale] reported by reviewdog 🐶 [OpenSearch.Spelling] Error: perfomed. If you are referencing a setting, variable, format, function, or repository, surround it with tic marks. Raw Output: {"message": "[OpenSearch.Spelling] Error: perfomed. If you are referencing a setting, variable, format, function, or repository, surround it with tic marks.", "location": {"path": "_data-prepper/pipelines/configuration/processors/delete-entries.md", "range": {"start": {"line": 34, "column": 79}}}, "severity": "ERROR"}
|`delete_from_element_when` | No | Specifies the condition needed to delete the key from each element of a list whe using `iterate_on` |

Check failure on line 35 in _data-prepper/pipelines/configuration/processors/delete-entries.md

View workflow job for this annotation

GitHub Actions / style-job

[vale] reported by reviewdog 🐶 [OpenSearch.Spelling] Error: whe. If you are referencing a setting, variable, format, function, or repository, surround it with tic marks. Raw Output: {"message": "[OpenSearch.Spelling] Error: whe. If you are referencing a setting, variable, format, function, or repository, surround it with tic marks.", "location": {"path": "_data-prepper/pipelines/configuration/processors/delete-entries.md", "range": {"start": {"line": 35, "column": 113}}}, "severity": "ERROR"}
| `iterate_on` | No | A string that specifies the key of the list of objects to iterate over and delete the keys specified in `with_keys`

## Usage

Expand All @@ -33,10 +43,13 @@
pipeline:
source:
...
....
....
processor:
- delete_entries:
with_keys: ["message"]
entries:
- with_keys: [ "message" ]
- with_keys_regex: [ "^tes.*" ]
exclude_from_delete: [ "test" ]
sink:
```
{% include copy.html %}
Expand All @@ -46,13 +59,13 @@
For example, before you run the `delete_entries` processor, if the `logs_json.log` file contains the following event record:

```json
{"message": "hello", "message2": "goodbye"}
{"message": "hello", "message2": "goodbye", "test": "friends", "test2": "are", "test3": "kind"}
```

When you run the `delete_entries` processor, it parses the message into the following output:

```json
{"message2": "goodbye"}
{"message2": "goodbye","test": "friends"}
```

> If `message` does not exist in the event, then no action occurs.
> If `with_keys`, `with_keys_regex`, or `exclude_from_delete` values do not match any event keys, then no action occurs.
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ Only the selected entries remain in the processed event and while all other entr
You can configure the `select_entries` processor using the following options.

| Option | Required | Description |
| :--- | :--- | :--- |
| `include_keys` | Yes | A list of keys to be selected from an event. |
| `select_when` | No | A [conditional expression]({{site.url}}{{site.baseurl}}/data-prepper/pipelines/expression-syntax/), such as `/some-key == "test"'`, that will be evaluated to determine whether the processor will be run on the event. If the condition is not met, then the event continues through the pipeline unmodified with all the original fields present. |
| :--- |:---------| :--- |
| `include_keys` | No | A list of keys to be selected from an event. |
| `include_keys_regex` | No | A regex pattern that matches the keys to be selected from an event. |
| `select_when` | No | A [conditional expression]({{site.url}}{{site.baseurl}}/data-prepper/pipelines/expression-syntax/), such as `/some-key == "test"'`, that will be evaluated to determine whether the processor will be run on the event. If the condition is not met, then the event continues through the pipeline unmodified with all the original fields present. |

## Usage

Expand All @@ -32,6 +33,7 @@ pipeline:
processor:
- select_entries:
include_keys: [ "key1", "key2" ]
include_keys_regex: ["^ran.*"]
select_when: '/some_key == "test"'
sink:
```
Expand All @@ -41,13 +43,22 @@ pipeline:
For example, when your source contains the following event record:

```json
{"message": "hello", "key1" : "value1", "key2" : "value2", "some_key" : "test"}
{
"message": "hello",
"key1" : "value1",
"key2" : "value2",
"some_key" : "test",
"random1": "another",
"random2" : "set",
"random3": "of",
"random4": "values"
}
```

The `select_entries` processor includes only `key1` and `key2` in the processed output:
The `select_entries` processor will output:

```json
{"key1": "value1", "key2": "value2"}
{"key1": "value1", "key2": "value2", "random1": "another", "random2" : "set", "random3": "of", "random4": "values"}
```

### Accessing nested fields
Expand Down
Loading