Hi,
I have some issues with rename a nested field in json.
Example of nested field:
test_results.result.legacy.entities.user_mentions.name
then i want to rename it to displayname
I have try this method, but unfortunately, it only rename the field to test_results.result.legacy.entities.user_mentions.namedisplay
instead of namedisplay
only
Example of method:
ruby {
code => "
user_mentions = event.get('[test_results][result][legacy][entities][user_mentions]')
if user_mentions
b = []
user_mentions.each { |k|
k['namedisplay'] = k['name']
k.delete('name')
logger.info('for each k', 'value' => k)
b << k
}
event.set('[test_results][result][legacy][entities][user_mentions]', b)
end
"
}
Really appreciated with all your help. Thanks