How to convert output of task in dictionary

Hi All,

I am new to ansible working on a requirement where the the command has been executed and output has been stored in register.

Need your guidance to find how to change the out put in dictionary or json file format.