Hello,
I want to set fields for the below mentioned json .However I am unable to set fields for the nested json.
Json example:
{“message”:“Hello”,“data”:{“TrnId”:“101”,“InstId”:“504”}}
I need set fields for the nested json fields TrnId and InstId along with message.
Here is the Output which i get
Pipeline which i used to extract the Json.
rule “extract-json”
when
starts_with(to_string($message.message), “{”) && ends_with(to_string($message.message), “}”)
then
let json = parse_json(to_string($message.message));
let map = to_map(json);
set_fields(map);
end
Kindly let me know if I have entered anything incorrectly.