I would like to be able to fetch keys from hash if there is any within the record.
For example if using this kubernetes plugin, I'd like to be able to use the kubernetes_namespace within the message for example.
In order to do that, I considered that key which contain a "." could be interpreted as an attempt to access a nested hash. So if there is any dot, I extract the value of "the first key" (at the left of the first dot), extract the corresponding part of the record and call the same function with that piece of record and what remain of the key.
As an example, this record :
{"json":"message", "hash":{"random":"test", "sub-key":{"sub-sub_key":"Im a sub sub key"} } }
Hi @sonots,
I would like to be able to fetch keys from hash if there is any within the record. For example if using this kubernetes plugin, I'd like to be able to use the kubernetes_namespace within the message for example.
In order to do that, I considered that key which contain a "." could be interpreted as an attempt to access a nested hash. So if there is any dot, I extract the value of "the first key" (at the left of the first dot), extract the corresponding part of the record and call the same function with that piece of record and what remain of the key.
As an example, this record :
With this config for the message :
Should return : Im a sub sub key
What do you think ?
Best regards