I was trying to parse a json log using data prepper processor called “rename_keys” but I found that it is not possible to have parsing implemented on nested json keys to some other nested json keys.
Hi @mann Thanks for trying out Data Prepper. This can be achieved in 2 ways,
Using substitute_string Processor - You can define a regex pattern using this processor to replace the matching string . I think this approach suits your use-case if you want to send the log as it is to sink after renaming value. substitute_string - OpenSearch documentation
Using parse_json Processor - Using this you can extract the level2 as a separate field and apply rename_keys. With this approach you will lose the outer key when you extract the level2 in to separate field. rename_keys - OpenSearch documentation
Config example: