delete_entries

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.

Configuration

You can configure the delete_entries processor with the following options.

OptionRequiredDescription
with_keysYesAn array of keys for the entries to be deleted.

Usage

To get started, create the following pipeline.yaml file:

  1. pipeline:
  2. source:
  3. ...
  4. ....
  5. processor:
  6. - delete_entries:
  7. with_keys: ["message"]
  8. sink:

copy

Next, create a log file named logs_json.log and replace the path in the file source of your pipeline.yaml file with that filepath. For more information, see Configuring Data Prepper.

For example, before you run the delete_entries processor, if the logs_json.log file contains the following event record:

  1. {"message": "hello", "message2": "goodbye"}

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

  1. {"message2": "goodbye"}

If message does not exist in the event, then no action occurs.

delete_entries - 图1