title: Python Filter JSON array data
body: <p>I am trying to extract the required info from a JSON response. Under computer_network_adapter_summary there are multiple adapters from some responses there are 5 and in some responses &gt;12. I am only interested in <strong>Ethernet (where name contains &quot;Intel(R) Ethernet&quot;)</strong> and <strong>wifi (where name contains &quot;Intel(R) Dual Band Wireless&quot;)</strong></p>
  <p>Is there any way I can filter only the required two adapter's mac addresses instead of all adapters? Thanks in advance.</p>
  <pre><code>response ='{&quot;message_response&quot;:{&quot;compdetailssummary&quot;:{&quot;computer_summary&quot;:{&quot;computer_name&quot;:&quot;ABC&quot;,&quot;primary_owner&quot;:&quot;Windows User&quot;,&quot;domain_name&quot;:&quot;WORKGROUP&quot;},&quot;computer_network_adapter_summary&quot;:[{&quot;dhcp_status&quot;:&quot;Enabled&quot;,&quot;adapter_name&quot;:&quot;[00000001] Fortinet Virtual Ethernet Adapter (NDIS 6.30)&quot;,&quot;mac_address&quot;:&quot;00:00:0F:00:00:01&quot;,&quot;dhcp_server&quot;:&quot;-&quot;,&quot;ip_address&quot;:&quot;-&quot;,&quot;gateway&quot;:&quot;-&quot;},{&quot;dhcp_status&quot;:&quot;Enabled&quot;,&quot;adapter_name&quot;:&quot;[00000004] Intel(R) Ethernet Connection I219-LM&quot;,&quot;mac_address&quot;:&quot;00:00:0F:00:00:01&quot;,&quot;dhcp_server&quot;:&quot;-&quot;,&quot;ip_address&quot;:&quot;-&quot;,&quot;gateway&quot;:&quot;-&quot;},{&quot;dhcp_status&quot;:&quot;Enabled&quot;,&quot;adapter_name&quot;:&quot;[00000005] Intel(R) Dual Band Wireless-AC 8260&quot;,&quot;mac_address&quot;:&quot;00:00:0F:00:00:01&quot;,&quot;dhcp_server&quot;:&quot;1.1.9.1&quot;,&quot;ip_address&quot;:&quot;1.2.9.3&quot;,&quot;gateway&quot;:&quot;1.1.8.1&quot;},{&quot;dhcp_status&quot;:&quot;Enabled&quot;,&quot;adapter_name&quot;:&quot;[00000007] Bluetooth Device (Personal Area Network)&quot;,&quot;mac_address&quot;:&quot;00:00:0F:00:00:01&quot;,&quot;dhcp_server&quot;:&quot;-&quot;,&quot;ip_address&quot;:&quot;-&quot;,&quot;gateway&quot;:&quot;-&quot;},{&quot;dhcp_status&quot;:&quot;Disabled&quot;,&quot;adapter_name&quot;:&quot;[00000002] PPPoP WAN Adapter&quot;,&quot;mac_address&quot;:&quot;-&quot;,&quot;dhcp_server&quot;:&quot;--&quot;,&quot;ip_address&quot;:&quot;--&quot;,&quot;gateway&quot;:&quot;--&quot;},{&quot;dhcp_status&quot;:&quot;Enabled&quot;,&quot;adapter_name&quot;:&quot;[00000003] Fortinet SSL VPN Virtual Ethernet Adapter&quot;,&quot;mac_address&quot;:&quot;00:00:0F:00:00:01&quot;,&quot;dhcp_server&quot;:&quot;--&quot;,&quot;ip_address&quot;:&quot;--&quot;,&quot;gateway&quot;:&quot;--&quot;}]}}}'
  json_data = json.loads(response)
  
  computername = json_data['message_response']['compdetailssummary']['computer_summary']['computer_name']
  ethMacAdd = json_data['message_response']['compdetailssummary']['computer_network_adapter_summary']
  wifiMacAdd = json_data['message_response']['compdetailssummary']['computer_network_adapter_summary']
  
  for item in json_data['message_response']['compdetailssummary']['computer_network_adapter_summary']:
      if item[&quot;adapter_name&quot;] = &quot;Intel(R) Dual Band Wireless&quot;:
          print(json_data['message_response']['compdetailssummary']['computer_network_adapter_summary'][0][&quot;adapter_name&quot;])
  </code></pre>