Selecting JSON data: JSON queries
To select a single element or a data subset from a complex data structure in JSON format (for example, Ansible facts), use thecommunity.general.json_queryfilter.  Thecommunity.general.json_queryfilter lets you query a complex JSON structure and iterate over it using a loop structure.
Consider this data structure:
To extract all clusters from this structure, you can use the following query:
To extract all server names:
To extract ports from cluster1:
To print out the ports from cluster1 in a comma-separated string: