Skip to content

Delete entries processor enhancements using regular expressions #6087

Description

@alamzeeshan

Is your feature request related to a problem? Please describe.
Right now delete process entries processor provides a basic functionality of deleting fields listed under with_keys

Describe the solution you'd like
I would like to allow regular expression in with_keys which will delete any field matching the regex. Also

  • a pointer option to specify the root field from the JSON data under which fields would be matched for deletion.
  • a whitelist_names option to skip these fields for deletion.
  • a delete_when option to conditionally apply this processor.

This can e.g. be useful if you have a parse_json or key_value processor that creates a number of fields with names that you don’t necessarily know the names of beforehand, and you only want to keep a subset of them.

Something in lines of logstash prune filter.

Describe alternatives you've considered (Optional)
NA

Additional context
Example config:

processor:
    - delete_entries:
        with_keys: ["message", "[^._\w]"]
        whitelist_names: [ "body-123" ]
        pointer: "/logs"
        delete_when: '/resource/attributes/k8s_label.sourcetype == "kv_pairs_generic"'

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestquestionFurther information is requested

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions