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"'
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_keysDescribe the solution you'd like
I would like to allow regular expression in
with_keyswhich will delete any field matching the regex. Alsopointeroption to specify the root field from the JSON data under which fields would be matched for deletion.whitelist_namesoption to skip these fields for deletion.delete_whenoption 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: